grosse
March 12th, 2002, 14:15
this is similar to that hook post earlier...
suppose i create a keyboard hook
hhk = SetWindowsHookEx (WH_KEYBOARD, KeyboardProc, NULL, ThreadId);
how do i post a message to the pogram which created this hook from the KeyboardProc ... eg. to show a window or to send the WM_QUIT msg?
KeyboardProc is a pointer to a func. which handles the hook processing. Now i tried out a PostThreadMessage() to post a msg to the thread from which i set the hook by setting a global variable to contain the thread id i reqd. but within KeyBoardProc this variable appears to contain 0. I tried out static keyword before the global variable ( type DWORD ) but no go
suppose i create a keyboard hook
hhk = SetWindowsHookEx (WH_KEYBOARD, KeyboardProc, NULL, ThreadId);
how do i post a message to the pogram which created this hook from the KeyboardProc ... eg. to show a window or to send the WM_QUIT msg?
KeyboardProc is a pointer to a func. which handles the hook processing. Now i tried out a PostThreadMessage() to post a msg to the thread from which i set the hook by setting a global variable to contain the thread id i reqd. but within KeyBoardProc this variable appears to contain 0. I tried out static keyword before the global variable ( type DWORD ) but no go