|
-
December 23rd, 2006, 08:42 AM
#1
Can't set windows hook - what wrong with my code ?
Hi All,
I need to catch all keyboard event and some of the keyboard keys i need to intercept.
So i using windows hook to do it.
But in some reason when i do "SetWindowsHookEx" i getting wrong return code and my hook does not working.
This is my code ( just the relevant part ):
LRESULT CALLBACK KeyboardProc(int code, // hook code
WPARAM wParam, // virtual-key code
LPARAM lParam // keystroke-message information
)
{
LRESULT lRetCode = 0;
return lRetCode;
}
LRESULT SetHook()
{
HINSTANCE hinstance = NULL;
HHOOK hookHandle = NULL;
LRESULT lRetCode = 0;
hookHandle = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, hinstance, 0);
return lRetCode;
}
What i did wronge ?
Thanks for any help.
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
|