|
-
May 14th, 1999, 07:29 AM
#1
How to block messages going to an application by using a hook?
Hi,
I am writing an application which examines WM_CHAR messages (using a system-wide WH_GETMESSAGE hook) going to any active application with the keyboard focus. If the message contains the character I am looking for, I'll route this keystroke message to my application instead (using SendMessage). In addition, I would want to prevent the original message from reaching the window with the keyboard focus.
How can I block WM_CHAR messages from reaching their destinations in my hook? Could I change the hWnd param stored in the WM_CHAR message (substitute with my application's hWnd) and deceive the system? In fact if I do this, I could kill two birds with one stone. I did try this idea, but it didn't seem to work. Maybe I did something wrong somewhere?
Could anyone help me out here? Thanx.
Ming Wah.
PS: Also, I did explore using the keyboard hook, which *could* prevent WM_KEYDOWN and WM_KEYUP messages from going to their destinations. However, this doesn't really serve my purpose because without translating these keyups and keydowns, I don't get capital letters.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|