0

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.

Lorenzo Pistone
  • 5,028
  • 3
  • 34
  • 65

1 Answers1

1

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.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • in your experience, is it enough to have a thread entirely dedicated to this hook (a simple `GetMessage` loop, a sort of fast dispatching to the main thread, real time priority) to mitigate the performance problems? – Lorenzo Pistone Oct 08 '12 at 02:16
  • the mouse is not very responsive. This could be caused by the fact that the thread that installed the hook is not entirely dedicated to the message loop (it pumps them with `PeekMessage` then `GetMessage`, it does not wait for them in a blocking call to `GetMessage`). – Lorenzo Pistone Oct 08 '12 at 09:08