Caveats
You must remember that this hook only intercepts posted messages. Any message sent to a window using SendMessage-type API calls will not be captured. Also, this hook might modify the message. Take care when modifying any message; verify that it will not adversely affect any other functionality.
This hook functions differently when running in the VB IDE than when
running from inside an EXE. The difference is that while running in
the IDE, an additional PeekMessage is performed
with a PM_NOREMOVE flag. This simply examines the
message and its details but does not remove it from the message
queue. The message is removed from the message queue in a subsequent
PeekMessage call. See Figure 11-1 and Figure 11-2 for examples
of this.
As always, you must take performance into consideration when using this hook, especially when the hook is system-wide.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access