After searching for some hook information and the original code on the Internet, a friend suggested: How many mouse clicks a day?
Haha, with such a problem. The global mouse and keyboard hook are used.
Program: http://download.csdn.net/source/639043
Implemented functions:
1. count the number of left-click clicks from the start to the stop period (double-click is counted as two clicks), the number of right-click clicks, and the total number of clicks.
2. Count the characters entered by the keyboard from the start time to the end time.
3. Start the instance.
4. Hide automatically at startup. // Press Alt + Ctrl + S to display, ALT + Ctrl + H to hide the interface
5. Write logs: Save the mouse clicks and keyboard input information in the TXT file of the current directory.
For specific technologies, refer:
1. Hook programming (msdn): http://blog.csdn.net/andylin02/archive/2007/04/03/1550318.aspx
2. Hook programming example: http://blog.csdn.net/andylin02/archive/2007/04/03/1550323.aspx
3. hotkey display window: http://blog.csdn.net/andylin02/archive/2008/09/19/2952364.aspx
4. Getting started with message Hook Functions
5. programming example of system HOOK: http://blog.csdn.net/andylin02/archive/2008/09/11/2913769.aspx