Sign in to follow this  
Followers 0
Xichael

How to use WinGetState

2 posts in this topic

The example WinGetState script in the documentation isn't working for me. Could someone better explain how this works?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi! Its not hard, example:

$title = "[Class:Notepad]"

Run("notepad.exe")

WinWait($title)

If BitAND(WinGetState($title), 2) Then ;If winsow is visible
    MsgBox(0, "Msg", "Now notepad window are minimized", 2)
    WinSetState($title, "", @SW_MINIMIZE)
EndIf

Sleep(2000)

If BitAND(WinGetState($title), 16) Then ;If winsow is minimized
    MsgBox(0, "Msg", "Now notepad window are restored", 2)
    WinSetState($title, "", @SW_RESTORE)
EndIf
:) Edited by rasim

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