[RESOLVED] Sending keypresses to an application
Hey all,
Is there anyway to simulate a keystroke on the keyboard to an application? Previously, I've been using SendKeys(), but this only sends a keystroke to the window which is in focus. Is there any other command or API which allows you to send to a certain handle? Also if there is, Is there a way to return the hWnd of an app if I have the name of it?
Thanks in advance :D
Re: Sending keypresses to an application
For finding out an apps hWnd and the child controls hWnds you'll need FindWindow and FindWindowEx APIs
Sending keystrokes to a particular hWnd involves the use of SendMessage or PostMessage APIs with WM_KEYDOWN and WM_KEYUP messages.
For more info on the APIs go to AllAPI.net
For more info on the messages, go to MSDN
Edit: & search the forums for examples of all of those :thumb:
Re: Sending keypresses to an application
Thanks alot for the fast response :D
Ill try out those sites, ty