Sign in to follow this  
Followers 0
Hypertrophy

[FIXED] get state of gui/control

5 posts in this topic

#1 ·  Posted (edited)

Is this the right way to check to see if a GUI is minimize or not? Because even when the GUI's are minimized the msgbox() saying so never pops up. only the msgbox(0,"","icons are restored") appears no matter what.

For $i = 1 To $ahInput[0][0]

If WinGetState($ahInput[$i][0]) = @SW_MINIMIZE Then; if already minimized then restore

msgbox(0,"","minimized")

GUISetState(@SW_RESTORE, ($ahInput[$i][0]))

Else; if they are restored then minimize them

msgbox(0,"","restored")

GUISetState(@SW_MINIMIZE, ($ahInput[$i][0]))

EndIf

Next

[code]For $i = 1 To $ahInput[0][0]
        $icostate = WinGetState($ahInput[$i][0])
        If BitAnd($icostate, 16) Then
            WinSetState($ahInput[$i][0], "", @SW_RESTORE)
        ElseIf BitAnd($icostate, 2) Then 
            WinSetState($ahInput[$i][0], "", @SW_MINIMIZE)
        EndIf
    Next
Edited by Hypertrophy

Share this post


Link to post
Share on other sites



Is there any way to hide the gui instead of minimizing them?

Share this post


Link to post
Share on other sites

Use this to get the window state and modify it. Look into helpfiles for more help.

$hIE = _IEPropertyGet($var, "hwnd") ; Get the handle

WinSetState($hIE, "", @SW_HIDE) ; Hide it

Share this post


Link to post
Share on other sites

cool. thanks. and they way they are hiding themselves is like one by one. it'll hide one then the next and so on. is there something i can do maybe with my for loop that'll hide them all at once?

Share this post


Link to post
Share on other sites

I dont think you can hide all windows at once with one function, if that is what you are talking about. Just put more hide functions if you need to hide more windows.

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