Jump to content
dinotom

Holding script until program load completes

Recommended Posts

I am writing a morning routine to open all the trading applications I require each day in the early morning. Since they are closing and re-opening while I'm asleep, speed isn't much of a requirement. My first real heavy duty script with AutoIT

I currently use Sleep(30000) to allow one of the longer opening apps to complete, but I would prefer to do it by capturing when the program load completes (The floating toolbar becomes active) I tried using the following and eliminating the Sleep command

WinWaitActive("X_TRADER Pro - TDFL_Jupiter2","",5)

since the toolbar opens first but is not active until all the other screens open. The script just continues on BEFORE the toolbar becomes active, which fouls the next steps as text isn't going where it should since other windows are opening and becoming active.

 

Any help appreciated.

Share this post


Link to post
Share on other sites

So then what is the difference between the two? I thought WinWaitActive waits until that window becomes active? If I remove the optional third parameter will it just wait til it is active?

Share this post


Link to post
Share on other sites
Just now, dinotom said:

So then what is the difference between the two? I thought WinWaitActive waits until that window becomes active? If I remove the optional third parameter will it just wait til it is active?

Yes, but it also can wait indefinitely if the windows does not get activated...So putting a large number like 60 could solve both problems.

Share this post


Link to post
Share on other sites

The answer is yes, I removed the third parameter and it works as expected. I misread the third parameter, I thought it waited 5 seconds after being active.

Thanks for the help

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

×
×
  • Create New...