Send a key to a process

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Bremy
Newbie
Posts: 1
Joined: Mon Dec 14, 2009 12:29 pm

Send a key to a process

Post by Bremy » Mon Dec 14, 2009 12:34 pm

hi

i want do a keypresser for a game...
for moment i can use sendkey with game window on screen and active.


Can i do same with windows minimized, via handle (then i could launch 2 or 3 client of game and send at each a key) ?

For example send a "A"

Regards

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Dec 15, 2009 12:56 am

You cannot send a key to a minimized window using Send.

You must use SetFocus on a window before you can do Send or MouseMove commands.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Dec 15, 2009 3:07 am

Bob is correct. Send> requires the window and also the field of the window be focused to receive text.

Some windows can use SetControlText>. Look up SetControlText in help.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts