Win32 hooks (WH_MOUSE)

Hello all!

I have problem establishing Win32 hook for mouse events (WH_MOUSE). When mouse cursor is in main frame window boundaryes everithing is ok, my hook is called, but when
mouse cursor leaves window, my hook function is not called.
Who can explain me wats metter?
Thenk you beforehend. George.
george_777Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jkrConnect With a Mentor Commented:
Yes. The problem is, that when you want to capure events that are not related to your application's window, the hook proc must reside in a DLL, as system-wide hooks are simply mapped into the other processes' addres spaces. Additionally, when calling 'SetWindowsHookEx()', you'll have to set the thread id to '0' and provide the DLL's instance handle (obtained via 'LoadLibrary()'). If you need an example, feel free to ask and i'll mail it to you.
0
 
george_777Author Commented:
Thank you very much jkr!
Everything works good!
0
 
sergiob2004Commented:
No way, at least under Windows XP + SVP2 WH_MOUSE won't go global, you must use WH_MOUSE_LL instead.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.