Thats it. Please guide me and tell me what libs and methods to use. I am using VC98. It will be great if you can tell me some links too, but basically I am looking for some straight forward lines of code.

I'm not sure there is a straightforward way to do what you want. I encourage you to be very specific about what you are trying to do. For example, if you want to monitor keystrokes resulting in ASCII/unicode chars then that program will be different than if you want to monitor all keystrokes, whether they result in a char being displayed or not (for example the tab key, shift key, arrow keys, etc.) For the former you could look at individual char in the input buffer and whenever a certain char is encountered do a certain task. For the latter you may want to monitor virtual key (VK) values, I believe they are in winuser.h. To have the program wait for a predetermined duration before proceeding I'd suggest looking up Sleep(), I believe it is in windows.h.