64 638
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #29866 in C++ for baqer

Question #29866
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...
Expert's answer
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.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions