Sign in to follow this  
Followers 0
cerveza

wait until a window has loaded content

10 posts in this topic

is there any way to do that?

Share this post


Link to post
Share on other sites



You can wait for text to show up, take a look at the "Winzip Installation" in the helpfile.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You can wait for text to show up, take a look at the "Winzip Installation" in the helpfile.

sorry, but that is of no use to me. that script uses WinWaitActive, which waits until a window is active. the case with my window is that it becomes active the second it is opened, but takes about 10 sec to load its content. and i need to pause the script until the content is fully loaded.

the window doesnt have any text in the conventional meaning of it. it just has one big control which includes all the text, buttons etc.

and ofc the ID changes each time.. if there is a way to retrieve all control IDs from a window then Id be interested in that.

but anyways, thank you for the feedback.

Edited by cerveza

Share this post


Link to post
Share on other sites

Can you make a screenshot with the controls which are loading? And beside that window the AutoIT window tool? Then i'll have a look.

Share this post


Link to post
Share on other sites

Posted Image

a screenshot of autoit window tool showing the properties of the only control the window has.

Share this post


Link to post
Share on other sites

Please also screenshot the tool with the control youre waiting for.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Ok i assume "Schließen" is the control you are waiting for. You can do this various ways. I can't give you a fully working code, but maybe i can point you in the right direction.

local $handle, $counter
Do
    $handle = ControlGetHandle("[CLASS:Windowsforms10.window.8.app.0.73da59]", "", "NameOfTheControlLikeSchließenOrSomethinglol")
    sleep(1000)
    $counter += 1
    if counter = 10 
        $counter = 0
        exitloop
    EndIf
until @error <> 1

If you leave the Sleep and counter out, you might be stuck in an endless loop. This construction will try 10 times and between each try 1 second delay. Play with the values.

You can also use the same construction with PixelSearch or GetPixelColor to wait for a specific pixel to show up and then exit the loop.

It might be needed to change the "CLASS:" to the window title, like Ubersicht.

Edited by notsure

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

got that idea in the meantime aswell and tested it. quite sad, but it does not work. the control handle can already be retrieved when the window is initialized, although the visual content of the window takes about 12 secs to arrive. quite strange also..

EDIT: color codes was a thing i though about eralier aswell, but didnt think autoit has the necessary functions for that. thanks for the help, gonna try it with the color functions.

Edited by cerveza

Share this post


Link to post
Share on other sites

I'd say try that with various methods. Pixelsearch, PixelGetcolour, ControlFocus, ControlCommand (==visible?) etc...

Share this post


Link to post
Share on other sites

I'd say try that with various methods. Pixelsearch, PixelGetcolour, ControlFocus, ControlCommand (==visible?) etc...

working quite well with PixelGetcolour. thanks a ton, mate!

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