Thanks! This is exactly what I am looking for.
My application can now send the keystrokes to the active windows. However, whenever the active windows got some pop-up alert, my keystrokes failed (since the main windows were deactivated until the pop-up is removed) ... Is there anyway in VB for me to detect whether or not there is a pop-up windows, or to detect whether my keystrokes can be sent to the desired windows?
Thanks in advance!