sfresher Posted September 29, 2008 Posted September 29, 2008 I want to pause the script until one of the windows exists. So I used the following code: <autoit> WinWait ("Window 1" OR "Window 2" OR "Window 3") </auoit> But it appears that the code doesn't work. It hangs there forever.
Xand3r Posted September 29, 2008 Posted September 29, 2008 I want to pause the script until one of the windows exists. So I used the following code: <autoit> WinWait ("Window 1" OR "Window 2" OR "Window 3") </auoit> But it appears that the code doesn't work. It hangs there forever. WinWaitClose WinWaitNotActive Cheers. Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
sfresher Posted September 29, 2008 Author Posted September 29, 2008 WinWaitClose WinWaitNotActive Cheers. Thanks! But indeed, I mean I have to wait one of the three window to be opened, or active.
AdmiralAlkex Posted September 29, 2008 Posted September 29, 2008 I want to pause the script until one of the windows exists. So I used the following code: <autoit> WinWait ("Window 1" OR "Window 2" OR "Window 3") </auoit> But it appears that the code doesn't work. It hangs there forever.That's not how you use Or, and you can't use WinWait for this. It should be more like do sleep(50) until WinExists("Window 1") or WinExists("Window 2") .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
Xand3r Posted September 29, 2008 Posted September 29, 2008 ohh sorry i'm kinda sleepy i readuntil a window exits the first time Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
sfresher Posted September 30, 2008 Author Posted September 30, 2008 Thanks! This is exactly what I wanted to do. But one more question, what if I want to wait, but no longer than 5 minutes. How can modify the script? use a counter in a for loop? That's not how you use Or, and you can't use WinWait for this. It should be more like do sleep(50) until WinExists("Window 1") or WinExists("Window 2")
Demonic Posted September 30, 2008 Posted September 30, 2008 While WinExists("hWnd One", "") or WinExists("hWnd Two", "") or WinExists("hWnd Three", "") WEnd
sfresher Posted September 30, 2008 Author Posted September 30, 2008 Thanks! I see this one is same is do...until. But where do I specify the time out? While WinExists("hWnd One", "") or WinExists("hWnd Two", "") or WinExists("hWnd Three", "") WEnd
DW1 Posted September 30, 2008 Posted September 30, 2008 Something like this: $Timeout = 300000 ; 5 Minutes in miliseconds $Timer = TimerInit() While WinExists("hWnd One", "") or WinExists("hWnd Two", "") or WinExists("hWnd Three", "") If TimerDiff($Timer) > $Timeout Then ExitLoop ;~ ;Code goes here WEnd AutoIt3 Online Help
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