Sign in to follow this  
Followers 0
dummie84

send key stroke to multiple windows

4 posts in this topic

I'm trying to send keystroke f to multiple windows of the same program. iv goten how to make the key stroke, repeat it, pause it, and exit it all from seariching the examples that come with the autoit down load but am having a dificult time finding anything to help me with this part.

here is wat iv done:

#RequireAdmin
$count = 0
HotKeySet("!q", "Terminate")
HotKeySet("{PAUSE}", "TogglePause")
Global $Paused

While $count < 1
    Send ("f")
    Sleep(1000)
    ToolTip('Script is "Running"',0,0)
Wend

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

If anyone could steer me in the right direction id appreciate it :)

Share this post


Link to post
Share on other sites



Thanks, but when i add that as is to my script it crashes the script. i tried formating the[]'s to wat seemend proper does nothing. i did look into winlist in the example folder and when i run it it tells me the window name and handle ina 0x00000########ect format. mabie i just need to apply my paramaters diferently to the winlist( {"title" [, "text"]]) im assuming when i re formated it it worked since it didnt crash the script. Might clarify how i apply the winlist. if this could be clarified or another method could be mentioned id appreciate it. Thanks :)

Share this post


Link to post
Share on other sites

i think im on the right track here. iv modified the winlist example to print the names and handles to note pad so i can paste the handles into input boxes in my keystroke script. i have used constolsend to send to the handles saved as variables by the input boxes.

ths script runns follows directions but dosent send the keys troke to the window. heres wat i did.

#RequireAdmin
HotKeySet("!q", "Terminate")
HotKeySet("{PAUSE}", "TogglePause")
Global $Paused

$count = 0
$client1 = InputBox("Set the Client Handle", "Please run WinList and enter the appropriate handle for client 1 and click OK")
$client2 = InputBox("Set the Client Handle", "Please run WinList and enter the appropriate handle for client 2 and click OK")
$client3 = InputBox("Set the Client Handle", "Please run WinList and enter the appropriate handle for client 3 and click OK")
$client4 = InputBox("Set the Client Handle", "Please run WinList and enter the appropriate handle for client 4 and click OK")



While $count < 1
    Controlsend($client1,"", "","f")
    Sleep(100)
    Controlsend($client2,"", "", "f")
    Sleep(100)
    Controlsend($client3,"", "", "f")
    Sleep(100)
    Controlsend($client4,"", "", "f")
    Sleep(100)
    ToolTip('Script is "Running"',0,0)
Wend

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

in the controlsend example they had a edit1 in the "" before the input i tried with that in place 1st removed it 2nd no diferance either way. i noticed they said in comments needed to tell it where in the window to send the input if thats my case what would that those type of varriables in the program be called for me to search for the proper varable for my application,or a file in the application folder?

if any one has a idea about wat i need to do to make this work id greatly appreciate it. Thank you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0