Chapter 9. WH_CALLWNDPROC

The WH_CALLWNDPROC hook intercepts messages that you send through the SendMessage application programming interface (API) function. This hook can view messages, but it cannot modify or discard them. Normally, filter functions discard messages by not calling the CallNextHookEx function and returning a zero. But in the case of the WH_CALLWNDPROC hook, after the filter function is finished processing the message, it returns control to the SendMessage function, which then proceeds to send the message. For this reason, it is not possible to discard the sent message.

Get Subclassing and Hooking with Visual Basic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.