• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1455
  • Last Modified:

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.
0
george_777
Asked:
george_777
1 Solution
 
jkrCommented:
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now