Example()
Func Example()
Local $hWndNote = WinWait("[CLASS:Notepad]", "", 3)
WinActivate($hWndNote)
ConsoleWrite("- Notepad WinActivate" & @CRLF)
_WinShowState($hWndNote)
Sleep(3000)
WinSetState($hWndNote, "", @SW_MINIMIZE)
ConsoleWrite("- Notepad SW_MINIMIZE" & @CRLF)
_WinShowState($hWndNote)
Sleep(3000)
WinActivate($hWndNote)
ConsoleWrite("- Notepad WinActivate" & @CRLF)
;~ WinSetState($hWndNote, "", @SW_RESTORE)
;~ ConsoleWrite("- Notepad @SW_RESTORE" & @CRLF)
_WinShowState($hWndNote)
Sleep(3000)
EndFunc ;==>Example
Func _WinShowState($hWnd)
$state = WinGetState($hWnd)
ConsoleWrite("$state=" & $state)
If BitAND($state, 16) Then
ConsoleWrite(" is minimized" & @CRLF)
Else
ConsoleWrite(" not minimized" & @CRLF)
EndIf
ConsoleWrite("" & @CRLF)
EndFunc
;~ $WIN_STATE_EXISTS (1) = Window exists
;~ $WIN_STATE_VISIBLE (2) = Window is visible
;~ $WIN_STATE_ENABLED (4) = Window is enabled
;~ $WIN_STATE_ACTIVE (8) = Window is active
;~ $WIN_STATE_MINIMIZED (16) = Window is minimized
;~ $WIN_STATE_MAXIMIZED (32) = Window is maximized
Edit:
use WinActivate($hWndNote) to restore