Jump to content

2 winwaits at once


mud409
 Share

Recommended Posts

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
Link to comment
Share on other sites

$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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...