Jump to content

WinGetState WinSetState Help


EddCase
 Share

Go to solution Solved by Danp2,

Recommended Posts

Hi, I have a task that I need to be running, I'd like it to be running hidden.

Essentially What I'd like to do is if its hidden show it and If its showing hide it. I've got this and it works but there's got to be a better way

 

Opt ("WinTitleMatchMode", 2)

$State = WinGetState ("authserver.exe")
$Win = WinExists ("authserver.exe")


MsgBox (0, "Win " & $win, "State " & $State)


If $State = 7 Then
    WinSetState ("authserver.exe", "", @SW_HIDE)
ElseIf $State = 23 Then
    WinSetState ("authserver.exe", "", @SW_HIDE)
ElseIf $State = 39 Then
    WinSetState ("authserver.exe", "", @SW_HIDE)
ElseIf $State = 5 Then
    WinSetState ("authserver.exe", "", @SW_SHOW)
ElseIf $State = 21 Then
    WinSetState ("authserver.exe", "", @SW_SHOW)
ElseIf $State = 37 Then
    WinSetState ("authserver.exe", "", @SW_SHOW)
EndIf


I'm sure I'm going to be missing states using my code. Please any help would be greatly appreciated.
 

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