savage29 0 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 Share this post Link to post Share on other sites
AdmiralAlkex 125 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 Share this post Link to post Share on other sites
savage29 0 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? Share this post Link to post Share on other sites
Varian 8 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. Share this post Link to post Share on other sites
savage29 0 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", "") Share this post Link to post Share on other sites
Varian 8 Posted December 31, 2010 Either way will work: PreferredWinWaitActive("window", "") or WinWaitActive("window", "", 0) Share this post Link to post Share on other sites
savage29 0 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 Share this post Link to post Share on other sites