|
-
April 29th, 2004, 10:29 AM
#1
"hook" problem
I would like to hook some app from another app. Hook procedure (keyboard type) is in exe file. I don't want to use global hook so I used "local" like this:
HWND hwnd = ::FindWindow(NULL,"Some app to hook");
if(hwnd == NULL) return;
LPDWORD processID = NULL;
UINT threadID = GetWindowThreadProcessId(hwnd,processID);
if(threadID == 0) return;
m_hHook = SetWindowsHookEx(WH_KEYBOARD,hookproc,NULL,threadID);
When I use debug versions of both apps hook procedure is working correctly but when I use release versions it don't (SetWindowsHookEx is working fine). Any idea why?
Maybe there is another way to take control of keyboard in some process. I tray also to use separate hooking dll, but when I used GetProcAddress to get pointers to exported funcions it always return NULL. Please help me.
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
|