Jump to content

Recommended Posts

Posted

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.

Posted

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?

Posted
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.

Posted

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

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...