Search code examples
windowswinapiwindows-messagessetwindowshookex

WH_MOUSE_LL hook, avoid getting useless WM_MOUSEMOVE events


Is there a way, even a dirty hack, to avoid receiving WM_MOUSEMOVE events in a WH_MOUSE_LL hook? I'm interested only in wheel rotations and buttons. The performance cost of receiving WM_MOUSEMOVE is unnacceptable in my scenario.

I cannot use WH_MOUSE.


Solution

  • There is no way to tell a hook to not receive particular messages. When you hook the mouse, especially a low level hook, you receive everything the mouse does.