Hooking Key Events
There are different ways to catch the keys as they are being typed,
but one of the most efficient is to monitor system events for key
events. This is done with a hook, which forces Windows to call your own
functions when a certain type of event happens.
First, let's see how
you can set a hook to catch keyboard events, with SetWindowsHookEx(): Read more..