m designing a C++ app that runs in background. i want to inspect every key user presses from keyboard. do not know how to do that. guide me please...
1
Expert's answer
2013-05-08T08:44:51-0400
There are some things that you must implement.1. It may be not console application. (You can usewinapi, wtl, qt or some other widgets) 2. Your window should be hidden. i.e HWNDstealth; /*creating stealth (window is not visible)*/ AllocConsole(); //console stealth=FindWindowA("ConsoleWindowClass",NULL); ShowWindow(stealth,0); //0 - hide window 3. Then in winapi there isevent kbhit() (keyboard hit). In the loop you may look when this event is trigger and getch() (get char) char from it. This obtained char you can put either in file or in some console.
Comments
Leave a comment