|
-
June 5th, 2009, 10:42 AM
#1
Global hooking mouse click
Hello everyone,
I´m having a problem hooking mouse click. I want to make this hook global to 'catch' all mouse clicks (not only may app´s)
and to stop the hook chain. I want to do this in order to have a 'dead zone' in the screen where mouse clicks are disabled.
I compiled an external DLL with the hook procedure an used it from my application using:
hkprcSysMsg = (HOOKPROC)GetProcAddress(hinstDLL, "?mouseHookProc@@YGJHIJ@Z");
hhookSysMsg = SetWindowsHookEx(WH_MOUSE_LL, hkprcSysMsg, hinstDLL,0);
(mouseHookProcedure is a Hello World proc. that only shows a messageBox)
When I execute the app. and click left-button the message box appears but the hook chain continues. I tried using the function callNextHookEx and passing NULL value as first parameter:
CallNextHookEx( NULL , nCode , wParam, lParam );
But this seems not to work on Windows NT/XP since the firts parameter of this function is ignored in the last versions of windows.
I even tried not to call the callNextHookEx but the hook chain still continues. So my question is:
How can I make a global mouseclick hook that catches the clik and stops the chain in WinXP?
Thanks in advance.
Tags for this Thread
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
|