Jump to content

Recommended Posts

Posted

The windows load complete like this:

image.png.fcfe72a650c1da4ad617f6f271fbf36b.png

But if I use WinWaitActive ['TITLE'] ,  When the following window show, the code already running

image.png.330230b6ffe0d0a7a116bc65828af4e4.png

So, how to wait until the complete windows load?

Thanks all!

Posted

Synchronizing is probably one of the most complex things in automating GUI flows

" how to wait until the complete windows load"  depends on application and your definition of "complete windows load" 

  • Find an element you can sync on
  • See if the cursor is changing from hourglass to pointer
  • ....

Some functions that can help in this (but maybe a sleep 5000 is enough on the short term)

  1. https://www.autoitscript.com/autoit3/docs/functions/ControlGetText.htm
  2. https://www.autoitscript.com/autoit3/docs/functions/ControlGetHandle.htm
  3. https://www.autoitscript.com/autoit3/docs/functions/PixelChecksum.htm
  4. UIA functions
  5. WebDriver functions if its HTML
  6. sleep nnn milliseconds
  7. https://www.autoitscript.com/autoit3/docs/functions/ControlFocus.htm on an element thats last coming up

 

Posted

you can use Control Command to Check if Button or Edit etc . if is Visible:

example:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 88, 136, 81, 33)
$Button2 = GUICtrlCreateButton("Button2", 224, 104, 65, 41);button2
GUICtrlSetState(-1, $GUI_HIDE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
     Local $state = ControlCommand($Form1, "", "Button2", "IsVisible", "");check if Button2 is Visible
     if  $state = 1 Then
        ;
        MsgBox(0,"","Loaded")

        EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Button1
            GUICtrlSetState($Button2, $GUI_SHOW)
    EndSwitch
WEnd

 

none

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
×
×
  • Create New...