Article View: borland.public.cppbuilder.nativeapi
Article #2253Re: Still struggling with a DLL for keyboard hooking
From: antivari
Date: Fri, 16 Mar 2007 12:49
Date: Fri, 16 Mar 2007 12:49
36 lines
1970 bytes
1970 bytes
Gambit, thank you very much for the code. It compiled immediatelly, but I had to change one constant to get the code work. Instead of: > && ((lParam & 0x0000FFFF) == 0) // Skip if it's a repeat I used this: && ((lParam & 0x40000000) == 0) // Skip if it's a repeat Can you please confirm that my change is correct... I also have few more questions: * What is the main reason for using CreateWnd() and DestroyWnd() and not FormActivate() and Destructor, for handling hook activation? * Also, what is the main reason for testing HandleAllocated()? I ask this because I experienced that my original program (that used my old DLL) sometimes left the DLL in a state in which DLL could not be deteted by uninstall procedure, and I'm sure that I had the RemoveHook() on every possible place that app could exit. Now, I'll send the new code to one of my friends to test if this new approach is safe for other apps ;) Best Regards, Vladimir Stefanovic
Technical Details
Message-ID:
<45fa8441$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<45f9a429$1@newsgroups.borland.com> <45f9c0a3@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2dee6d400474aadb X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "antivari" <antivari@sbb.co.yu> Sender: "antivari" <antivari@sbb.co.yu> Reply-To: "antivari" <antivari@sbb.co.yu> Subject: Re: Still struggling with a DLL for keyboard hooking Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 195.252.72.241 X-Forwarded-For: 192.168.129.132 References: <45f9a429$1@newsgroups.borland.com> <45f9c0a3@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <45fa8441$1@newsgroups.borland.com> Date: 16 Mar 2007 04:49:21 -0800 X-Trace: newsgroups.borland.com 1174045761 207.105.83.66 (16 Mar 2007 04:49:21 -0800) Lines: 37 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail