Cusem Posted April 3, 2008 Posted April 3, 2008 Hey guys, I'm using a scripts that opens an x amount of windows. I want the script to halt until the new window is opened and identified by the script. Right now I'm using the following code: _OpenNewWindow() ;now I want the script to wait until a new window is opened (with a 3 second timeout) Local $old = WinList("WindowCommonString", "") Local $new = "" Local $timer = TimerInit() Do Sleep(50) $new = WinList("WindowCommonString", "") Until $old[0][0] <> $new[0][0] OR TimerDiff($timer) > 3000 ;detecting timeout If TimerDiff($timer) > 3000 Then _TimeOutMessage() ;now I want to identify the new window Local $found = 0 Local $NewWindow = "" For $a = 1 to $new[0][0] For $b = 1 to $old[0][0] If $new[$a][0] = $old[$b][0] Then $found = $found + 1 Next If $found = 0 Then $NewWindow = $new[$a][0] $a = $old[0][0];To exit the For..Next loop Endif Next This works, but I was wondering if there is an easier way to get the name of the new window.
weaponx Posted April 4, 2008 Posted April 4, 2008 Looks similar to something I wrote to detect any new processes:#414954#443881Should be easy to modify.
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