Jump to content
Sign in to follow this  
Xichael

How to use WinGetState

Recommended Posts

Xichael

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
rasim

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.