what happens if window not found

Recommended Posts

I have written a script to simulate keypresses and click on some windows

The work is repetitive.

Here I activate 'foobar' and click on a place in it then press few down arrow keys . Then some keypresses in 'reboot' window ...

(1)It sometimes happen that am external window pops up taking focus away from action being performed by script . As a result ,say, 'reboot' window does not appear . How should I bring scipt to run from beginning (of while loop) again ?

(2)I used window info tool to find coordinates of place to click . Is it possible that window info tool keeps updating mouse coordinate even when I do not drag its finder ?

(3)I would also like to add functionality to do an action on window 'new IP' , if found , in the infinite while loop .

Recently Browsing
0 members

Similar Content

Hi
So I am trying to click the green button, this button is not always in the same place. So fare I am trying to click it by finding the color but there is also something else with the same color on the screen (circled in yellow) that is causing issues. Is there a way to use the Title and Class of the window (can't be just the window as there are more than one with the same name).
How does AutoIt Info get this information?

question about _WinAPI_CreateWindowEx
good morning
welcome autoit team
please i need your help
i've searched a lot about how to use the _WinAPI_CreateWindowEx
finally i found an example
but i found some problem i hope you can help me
firstly, i want to set the controls focussable with the keyboard input
i already used the ws_tabStop but it did not work with me.
secondly, i want to set some access keys linked with the window
such as control+o enable the open button and control+f4 exit the app
note: i need a local access keys and not a global hotkeys
such as GUISetAccelerators
finaly, before i will put the code here i must clarify a few things.
1. you will ask me why you don't use the GUICreate function
here i'll tell you that it as dialog and It is a little heavy in motion with screen readers.
the screen readers for blind has some function that work with dialogs and others work with full windows style
2. you will ask me why you didn't search the net for that?
i will tell you that all examples that i found in the internet with pdfs and Picture books.
i found some examples in microsoft but it with cpp.
ok here is the code
i hope you can help me to do what i want
thank you in advance

Hello this is the code maybe you can figure it out I placed some comments to try and explain what I want
#include <Array.au3>
AnyDeskOpen()
Func AnyDeskOpen()
Global $aWinList = WinList("[REGEXPTITLE:(?i)(.*Anydesks*)]") ;get window name and handle from windows and store into an array
$asd = $aWinList
$aExtract = _ArrayExtract($asd) ; beginner babble clean this Sh** up
Global $default = _ArrayToString($aExtract, "", 0, 0)
EndFunc
StartWait() ; check in the array to see how many windows are opened
Func StartWait()
While 1
AnyDeskOpen()
If $Default = 1 Then
Sleep (3500)
Else
Exitloop
EndIf
WEnd
EndFunc
If $default = "2" Then ; If two windows are opened than someone is trying to connect to that computer and needs a click to accept connection try and click accept Button in the first window and the second one by activating diffrent window handle
$extra = _ArrayToString($aWinList, "", 1, 1)
$sString = StringReplace($extra, "AnyDesk", "")
$hGUI = $sString
WinActivate(HWnd($hGUI))
winmove (HWnd($hGUI), "", 50, 50)
Mouseclick ("left", 100, 500)
Sleep (1500)
$extra = _ArrayToString($aWinList, "", 2, 2)
$sString = StringReplace($extra, "AnyDesk", "")
$hGUI = $sString
WinActivate(HWnd($hGUI))
winmove (HWnd($hGUI), "", 50, 50)
Mouseclick ("left", 100, 500)
EndIf
While 1 ;up to here everything seems to work
AnyDeskOpen() ; while there is a connection there are two AnyDesk windows, if we close the connection than only one window remains opened and we check the array to see how many values it has
If $Default = 2 Then
Sleep (3500)
Else ; At this point the program exits code 0 instead of resseting to function above
StartWait()
Exitloop
EndIf
WEnd ; thank you
the intent is to keep the program going so it clicks accept again when reconnecting

hello sirs, please i created a tool witch get the focused control in a window and play a audio file linked with this controls
e.g buttons, checkBoxes, radios, comboboxes, and others
i know that their is a function that give us the control focus but it return the classNN
i want to get the class name to use it with a switch and
because their are more than class e.g button tbutton timagebutton tnewButton...
please can any one help me to get the class name not the classnn
thanks in advance

Hi everyone.
I want to ask about this :
I want it runs from 1 to 100 and It opens 10 firefox profiles then access youtube. After I close a firefox window, the loop runs and wait for another window close until loop ends
I have a loop like this.
Func launch()
Local $from = Int(GUICtrlRead($input1))
Local $to = Int(GUICtrlRead($input2))
If $to <> "" Then
While $from <= $to
Local $profile = $to
_RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com")
$to=$to+1
WEnd
Else
Local $profile = $to
_RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com")
EndIf
EndFunc
Is there any solution?
Thank you!