Jump to content

Recommended Posts

Posted

i am using control send to press enter continuously on a application, and i wondering if its possible to use it on 2 application with the same title

for example: pressing enter on 2 notepad opened with the same name.

thanks

Posted

Yes, you just have to use separate ControlSend calls and differentiate them by handle/instance/class/text.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Posted

i am using control send to press enter continuously on a application, and i wondering if its possible to use it on 2 application with the same title

for example: pressing enter on 2 notepad opened with the same name.

thanks

Try this example. There are 2 notepad windows and in everyone is send enter key. Press esc to quit.

AutoItSetOption("WinTitleMatchMode",2)
HotKeySet("{ESC}","Quit");PRESS ESC KEY TO QUIT
Run("notepad.exe")
Run("notepad.exe")

While 1
    $LIST = WinList("Notepad")
    If IsArray($LIST) Then
        For $INDEX = 1 To $LIST[0][0]
            ControlSend($LIST[$INDEX][1],"","Edit1","{ENTER}")
        Next
    EndIf
    Sleep(100)
WEnd

Func Quit()
    Exit
EndFunc
Posted (edited)

Try this example. There are 2 notepad windows and in everyone is send enter key. Press esc to quit.

AutoItSetOption("WinTitleMatchMode",2)
HotKeySet("{ESC}","Quit");PRESS ESC KEY TO QUIT
Run("notepad.exe")
Run("notepad.exe")

While 1
    $LIST = WinList("Notepad")
    If IsArray($LIST) Then
        For $INDEX = 1 To $LIST[0][0]
            ControlSend($LIST[$INDEX][1],"","Edit1","{ENTER}")
        Next
    EndIf
    Sleep(100)
WEnd

Func Quit()
    Exit
EndFunc
yup its working, is it possible to make it press enter at diferent time?

like 1 press enter every 5sec and the other every 7sec

i changed it slightly so it goes with what im trying to do

AutoItSetOption("WinTitleMatchMode",2)
HotKeySet("{ESC}","Quit");PRESS ESC KEY TO QUIT
ShellExecute("C:\Users\Gamer\Desktop\Xtreme\Loade.exe")
ShellExecute("C:\Users\Gamer\Desktop\Xtreme\Loade.exe")
WinWaitActive ( "SS_Client" )
WinWaitActive ( "SS_Client" )
sleep ( 5000 )

While 1
    $LIST = WinList("SS_Client")
    If IsArray($LIST) Then
        For $INDEX = 1 To $LIST[0][0]
            ControlSend($LIST[$INDEX][1],"","Edit1","{ENTER}")
        Next
    EndIf
    Sleep(100)
WEnd

Func Quit()
    Exit
EndFunc

and im not sure by putting winwaitactive twice would wait for both to load before it continues

thanks

Edited by XTensionX

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...