[AutoIT] Send Key

02/17/2009 16:12 sui~#1
Hello coders =)
i need your help, how to send keys to minimized/hidden aplication?
for example i got 2 game clients
i want play at client1, and set marco which send key "2" to minimized client2

Best Regards
sui~
02/17/2009 17:10 DamageBreaker#2
Controlsend() use this
02/17/2009 17:47 sui~#3
i need something else.. cause ControlSend maximize second client :S
02/17/2009 18:22 DamageBreaker#4
Quote:
Originally Posted by sui~ View Post
i need something else.. cause ControlSend maximize second client :S
what ? since when? k another try

1. search for your client with the PID
2. then use the attributes @sw_minimize or maximize
3. use a while loop that make controlsend and then sw_minimize or you block the process to maximize

or very easy take the window and drag it to the edge then it is invisible^^
02/19/2009 13:12 N.E.O.#5
ControlSend is the only order to send something to a hidden window.

For example:

PHP Code:
$hWnd = "World of Warcraft"


ControlSend($hWnd,"","","Hello World!") 

If you want to use ControlSend you must know how-to, look:


PHP Code:
ControlSend 
--------------------------------------------------------------------------------

Sends a string of characters to a control.


ControlSend ( "title", "text", controlID, "string" [, flag] )


 

Parameters

title The title of the window to access
. 
text The text of the window to access. 
controlID The control to interact with. See Controls. 
string String of characters to send to the control. 
flag [optional] Changes how "keys" is processed:
  
flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow.
  
flag = 1, keys are sent raw. 
Maybe you must use controlID and text for your hidden window.



#N.E.O.