dinotom Posted April 2, 2019 Share Posted April 2, 2019 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. Link to comment Share on other sites More sharing options...
Nine Posted April 2, 2019 Share Posted April 2, 2019 The sleep () is 30 secs, but you put 5 secs in WinWaitActive () ! “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
dinotom Posted April 2, 2019 Author Share Posted April 2, 2019 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? Link to comment Share on other sites More sharing options...
Nine Posted April 2, 2019 Share Posted April 2, 2019 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. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
dinotom Posted April 2, 2019 Author Share Posted April 2, 2019 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 Link to comment Share on other sites More sharing options...
dinotom Posted April 2, 2019 Author Share Posted April 2, 2019 Great point. Ill adjust the last parameter Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now