Jump to content

Recommended Posts

Posted

This is my code:

While 1
    While WinActive("PicTor - ") AND NOT WinActive("PicTor - Microsoft Visual Studio")  ; PicTor
        $pos = WinGetPos("[ACTIVE]")
        $size = WinGetClientSize("[ACTIVE]")
        If $pos[0] = 0 AND $pos[1] = 0 AND $size[0] = 1920 AND $size[1] = 1080 Then
            ; do something
        EndIf
        Sleep(10)
    WEnd
    Sleep(10)
WEnd

I get this error message sometimes when loosing focus off the "PicTor" window. When minimizing "PicTor" for example. I don't understand why... Why can't the script access $size[0]? I just declared it.

Posted

Since WinGetClientSize() returns an array in case of success, you could also check the variable with IsArray

 

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
×
×
  • Create New...