mud409 Posted January 28, 2008 Posted January 28, 2008 I have a part of my script where it waits till a window exsists to make it full screen. at the same time I have a winwait that I'm waiting for the closure of the main program. Now if I just have it wait for 1 or the other it works just fine I just can't get them to wait together.... here's the code I've been working with... any suggestions? If WinExists("MAME32k") Then If Not WinActive($gamename, "") Then WinActivate($gamename, "") WinWaitActive($gamename, "") WinSetState ($gamename, "", @SW_SHOWMAXIMIZED ) ElseIf WinWaitClose("MAME32k") Terminate() EndIf
Distrophy Posted January 28, 2008 Posted January 28, 2008 (edited) $var=0 Do If WinExists("MAME32k") Then If Not WinActive($gamename, "") Then WinActivate($gamename, "") WinWaitActive($gamename, "") WinSetState ($gamename, "", @SW_SHOWMAXIMIZED ) ElseIf WinWaitClose("MAME32k") Terminate() $var=1 EndIf Sleep( 5000 ) Until $var=1 You could try placing the IF statements in a loop like above and setting a variable like shown, or making the 'until' condition something relevant Edit: I would probably throw a sleep command in there after the endif so the loop doesnt tax your system unnecessarily. Edited January 28, 2008 by Distrophy
ZoSTeR Posted January 28, 2008 Posted January 28, 2008 (edited) If WinExists("MAME32k") Then ... ElseIf ; <- This should throw a syntax error. It needs a statement. In case you mean Else then WinWaitClose("MAME32k") ; this would always immediately return 1 because Mame32k already doesn't exist Terminate() EndIf Edited January 28, 2008 by ZoSTeR
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