Sign in to follow this  
Followers 0
mud409

2 winwaits at once

4 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Distrophy

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by ZoSTeR

Share this post


Link to post
Share on other sites

I'm retarded, thanks

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0