Ticket #3216: WinGetState Example.au3

File WinGetState Example.au3, 631 bytes (added by InunoTaishou, 5 years ago)
Line 
1#include <AutoItConstants.au3>
2
3Global $aStatesVal[] = [$WIN_STATE_EXISTS, $WIN_STATE_VISIBLE, $WIN_STATE_ENABLED, $WIN_STATE_ACTIVE, $WIN_STATE_MINIMIZED, $WIN_STATE_MAXIMIZED]
4Global $aStatesString[] = ["$WIN_STATE_EXISTS", "$WIN_STATE_VISIBLE", "$WIN_STATE_ENABLED", "$WIN_STATE_ACTIVE", "$WIN_STATE_MINIMIZED", "$WIN_STATE_MAXIMIZED"]
5Global $hWnd = WinGetHandle("[Active]")
6Global $sTitle = WinGetTitle($hWnd)
7
8For $i = 0 to UBound($aStatesVal) -1
9        ConsoleWrite("Dialog " & $sTitle & " " & (BitAND(WinGetState("[Active]"), $aStatesVal[$i]) ? "has" : "does not have") & " the state " & $aStatesString[$i] & @CRLF)
10Next