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   

 

posted @ 2013-08-16 15:29  chenpassion  阅读(2363)  评论(0编辑  收藏  举报