none
Windows Hooks

    Question

  • Hello,
    Is there a hook type that can intercept messages (such as WM_INPUT) while they're in the message queue without relying on the application?
    I have looked into the following types of hooks, but each have their own drawbacks:
    • WH_GETMESSAGE - relies on GetMessage or PeekMessage being called, which may not be feasible as I am checking for messages once per frame (so as not to compromise framerates), which is unacceptable for WM_INPUT messages
    • WH_CBT - doesn't seem to receive WM_INPUT messages
    • WH_MSGFILTER / WH_SYSMSGFILTER - don't seem to receive WM_INPUT messages
    Essentially, I need a hook that can reliably intercept WM_INPUT messages and discard them, before they reach the message queue. Is there a hook type I've overlooked?
    Thank you in advance
    Saturday, November 24, 2007 1:27 AM

Answers

  • Thank you for your response. The low level keyboard and mouse hooks are incufficient for my needs (I am receiving input from multiple mice). I have addressed this issue by using WH_GETMESSAGE as the hook type, and creating the window/managing the message queue in a separate thread to my program code.
    Saturday, November 24, 2007 10:05 AM

All replies

  • Try the low level keyboard / mouse hooks.
    Saturday, November 24, 2007 10:01 AM
  • Thank you for your response. The low level keyboard and mouse hooks are incufficient for my needs (I am receiving input from multiple mice). I have addressed this issue by using WH_GETMESSAGE as the hook type, and creating the window/managing the message queue in a separate thread to my program code.
    Saturday, November 24, 2007 10:05 AM