Before emulating a keystroke we must make sure that:
The window we want to send the keystroke must be in focus and active.
That we have the virtual key code for the key we want to generate.
The keys 'A-Z' and the keys '0-9' have a virtual key code that is the same as their ASCII code. For example, in order to generate the letter A we need to use the 'A' (or 65) as the virtual key code.
The 'keybd_event()' function has been superseded by 'SendInput()' on Window NT/2000/XP. Thus, on these operating systems you should use 'SendInput()' (unless you need to provide backward compatibility with Windows 98 etc.). This FAQ is based on 'SendInput()'.
Can I see some example on how to use 'SendInput()'?
Bookmarks