greena23 Posted August 31, 2010 Share Posted August 31, 2010 Hi, This may be a very rookie question, but is there any way to have a winwaitactive that only waits for a certain time. Or is there any way to do it that if it doesn't come up we check if something else is up and act on it accordingly. Any help would be great Link to comment Share on other sites More sharing options...
Varian Posted August 31, 2010 Share Posted August 31, 2010 Helpfile explains this explicitly!! WinWaitActive ( "title" [, "text" [, timeout]] ) Link to comment Share on other sites More sharing options...
Realm Posted August 31, 2010 Share Posted August 31, 2010 Use Sleep(1000), just change the value to 1000 for every second you need to wait. If you need to run other tasks while waiting, than see Timing functions TimerInit() & TimerDiff(). My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
greena23 Posted September 1, 2010 Author Share Posted September 1, 2010 Thanks for the help guys Just another thing, I'm having a bit of trouble in getting my if to work. I have If WinWaitActive("","",15) Then Do Something EndIF This will not work for me. Any suggestions Thanks! Link to comment Share on other sites More sharing options...
Realm Posted September 1, 2010 Share Posted September 1, 2010 (edited) Reading the help file, you will see that WinWaitActive Returns the handle of the window rather than a True statement, however If it happens to timeout, it will return a False statement. Try this: If WinWaitActive("","",15)<>0 Then Edit: Typos Edited September 1, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
Varian Posted September 1, 2010 Share Posted September 1, 2010 I am assuming that you are not using a blank Title to check if it is active, because there will (almost) always be some window that is active. Also, it is OK to return the Window Handle because the "If" statement will succeed as long as it DOES NOT return 0, a blank string, or false. Any thing returned other than those 3 values, and the statement is True, even it it returns -1. 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