Hooks for Detecting Global Mouse and Keyboard Movement
Posted on 1997-06-17
I need to write a program which detects Mouse Movement and Keyboard Input. Currently I'm trying to use HOOKS to accomplish this.
As it stands my program only works within my program window.
For example, I have my program display a message box everytime I click the left mouse button. However, when
I click the left mouse button outside the program window or anywhere on the desktop nothing happens. No message box
is displayed even though I clicked on the mouse button.
I'm using "if (wParam == WM_LBUTTONDOWN)"
to detect the left mouse button, but it's not global. Meaning it
only works on one window.
My question is how do I write a C++ program which detects
Mouse Movement and Keyboard Input anywhere, on any window on the desktop? Thanks.