savage29 Posted December 31, 2010 Share Posted December 31, 2010 gday people, i've been wondering all day if putting WinWaitActive at the start of a endless loop will automatically stop a script running when it doesnt detect the open window, like this While 1 WinWaitActive("window", "", 5) loop WEnd Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted December 31, 2010 Share Posted December 31, 2010 I don't get the question. WinWaitActive() waits for a window to become active. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
savage29 Posted December 31, 2010 Author Share Posted December 31, 2010 I don't get the question. WinWaitActive() waits for a window to become active.ummm ok. script starts, i click on the window i want active, it runs the loop. loop completes, goes back to winwaitactive.at that point, will the script stop if the target window is not highlighted? is that clearer for you? Link to comment Share on other sites More sharing options...
Varian Posted December 31, 2010 Share Posted December 31, 2010 If you do not supply a timeout for the WinWaitActive() function, then yes, the script will stop until the condition is met (Window becomes active). If the Window exists (or not) the script will continue to wait until that Window becomes active. Link to comment Share on other sites More sharing options...
savage29 Posted December 31, 2010 Author Share Posted December 31, 2010 If you do not supply a timeout for the WinWaitActive() function, then yes, the script will stop until the condition is met (Window becomes active). If the Window exists (or not) the script will continue to wait until that Window becomes active.ok so for this lineWinWaitActive("window", "", 5)do i change it to this?WinWaitActive("window", "", 0)or this?WinWaitActive("window", "") Link to comment Share on other sites More sharing options...
Varian Posted December 31, 2010 Share Posted December 31, 2010 Either way will work: PreferredWinWaitActive("window", "") or WinWaitActive("window", "", 0) Link to comment Share on other sites More sharing options...
savage29 Posted December 31, 2010 Author Share Posted December 31, 2010 Either way will work: PreferredWinWaitActive("window", "") or WinWaitActive("window", "", 0) varian, you are my new goddess thank you for your help, its well appreciated 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