Jump to content

Recommended Posts

Posted

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
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
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

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
  • Recently Browsing   0 members

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