AutoIT: WinSetState可以定义窗口大小

Example()
FuncExample()
    ; Run Notepad
    Run("notepad.exe")
    ; Wait 10 seconds for the Notepad window toappear.
    Local $hWnd =WinWait("[CLASS:Notepad]", "", 10)
    MsgBox(1,"Test1", $hWnd, 3)
    ; Convert the handle to a string.
    Local $sHWnd = String($hWnd)
    MsgBox(1,"Test2", $sHWnd, 3)
    ; Minimize the Notepad window and wait for2 seconds.
    WinSetState(HWnd($sHWnd), "",@SW_MINIMIZE)
    Sleep(2000)
 
    ; Restore the Notepad window and wait for 2seconds.
    WinSetState(HWnd($sHWnd), "",@SW_RESTORE)
    Sleep(2000)
    MsgBox(1,"Test3", HWnd($sHWnd))
    WinClose(HWnd($sHWnd)) ; Close the Notepadwindow.
    MsgBox(1,"Test4", HWnd($sHWnd))
EndFunc   
原文地址:https://www.cnblogs.com/autotest/p/3262234.html