Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
;WINWAITLISTEXIST.WBT (1KB) ;Make WinWaitEixst use delimited lists #DefineFunction WinWaitListExist(List, Timeout, Delimiter) NumOfElements = ItemCount(List, Delimiter) TimeAtInit=TimeYmdHms( ) While @True For i=1 to NumOfElements CurrentWin = ItemExtract(i, List, Delimiter) If WinExist(CurrentWin) then return i ;returns item number in delimited list Next If Timeout >= 0 ;Assume Negative Timeout means 'wait forever' TimeNow = TimeYmdHms() TimePassed=TimeDiffSecs(TimeNow, TimeAtInit) If TimePassed > Timeout then return @FALSE EndIf TimeDelay(1) ;Sleep for one second the check windows again EndWhile #EndFunction ;--------------------------------------------- ;Main Program Timeout = 3 Delimiter = @TAB List = Strcat("Some App", @TAB, "Untitled - Notepad", @TAB, "Some Other App") ;run without notepad being opened result = WInWaitListExist(List, Timeout, Delimiter) message("Result", result) ;now open Notepad Run("notepad.exe", "") result = WInWaitListExist(List, Timeout, Delimiter) Message("Result", result) ;-------------------------------------------------------
Article ID: W16241
File Created: 2004:03:30:15:43:32
Last Updated: 2004:03:30:15:43:32