We help IT Professionals succeed at work.

HowTo: Monitor Windows Messages

SADiver
SADiver asked
on
How can I (if possible) monitor ALL windows messages? Not just the messages sent to a certain window/control.

Basically I want to monitor ALL keyboard usage.
I Managed to do this for a window/control using

lpPrevWndProc = SetWindowLong(gHW, GWL_WNDPROC, _
AddressOf WindowProc)

with gHW= the handle to the window/control
and
WindowProc is my new Message Handler Procedure.
Comment
Watch Question

Head of Software Services
CERTIFIED EXPERT
Commented:
goto http://vbaccelerator.com and search for vbalhook. This includes a dll which can be used to hook into all keyboard and mouse messages, system wide. You cannot achieve a system wide hook in native vb and have to use a standard dll to do so. This dll here enables this and can be used easily in vb to see all keyboard activity.

Author

Commented:
TimCottee,
That was a showstopper!!!!
Thanks a lot!
Riaan

Explore More ContentExplore courses, solutions, and other research materials related to this topic.