|
-
Jun 12th, 2006, 01:40 AM
#1
Thread Starter
Hyperactive Member
[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
-
Jun 12th, 2006, 01:46 AM
#2
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
-
Jun 12th, 2006, 01:49 AM
#3
Thread Starter
Hyperactive Member
Re: Sending keypresses to an application
Thanks alot for the fast response 
Ill try out those sites, ty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|