how can i sendkeys to an application on my desktop?
any ideas guys?
Printable View
how can i sendkeys to an application on my desktop?
any ideas guys?
how about
VB Code:
SendKeys "lol."
but i want to pick the application to send to
Then I think you need to use APIs.
If you want a simple way use AppActivate...
It's a shotty but quick way to pull the program up front before sending the keys.VB Code:
AppActivate "Program's Title Here" SendKeys "Spit in my mouth, baby!"
thanks, by that do you mean the programs window title at the top? like for e.g, this window for me would beQuote:
Originally Posted by Spajeoly
VBForums - Reply to Topic - Microsoft Internet Explorer
Yeah, thats what Spajeoly meant. The other option you could use other than window title is the window handle. You could check it using Spy++, Ive used this option to move windows and sendkeys too. But I find sometimes for a window/program the handle changes which makes using the Program title or window name easier.Quote:
thanks, by that do you mean the programs window title at the top? like for e.g, this window for me would be
VBForums - Reply to Topic - Microsoft Internet Explorer
Is there a way without using APIs' to list the currently open window names?
For example, if I wanted to send it to this browser window I'd want to us left$() because I'd have these options:
VBForums - Reply to Topic - Microsoft Internet Explorer
VBForums - Reply to Topic - Mozilla Firefox
No, you'd need to use an API to list the currently open windows.
If you're looking for a specific window all the time, you can use the FindWindow API, with the class name (you can get that in Spy++ iirc).
Other than that, you have to enumerate all the open windows!
thanks guys, but how can i then hit the enter button on the keyboard?
currently i tested it on a messenger conversation i had open with myself
i sent the message 'hello'
it put 'hello' in the messenger send box, this is fine, but i also wana make it hit enter!
Im sure about 50 other people have asked this, have you had a good search of the forums?
If your using SendKeys then it's {ENTER} or ~ .