Example()
FuncExample()
; Run Notepad
Run("notepad.exe")
; Wait seconds for the Notepad window toappear.
Local $hWnd =WinWait("[CLASS:Notepad]", "", )
MsgBox(,"Test1", $hWnd, )
; Convert the handle to a string.
Local $sHWnd = String($hWnd)
MsgBox(,"Test2", $sHWnd, )
; Minimize the Notepad window and wait for2 seconds.
WinSetState(HWnd($sHWnd), "",@SW_MINIMIZE)
Sleep()
; Restore the Notepad window and wait for 2seconds.
WinSetState(HWnd($sHWnd), "",@SW\_RESTORE)
Sleep()
MsgBox(,"Test3", HWnd($sHWnd))
WinClose(HWnd($sHWnd)) ; Close the Notepadwindow.
MsgBox(,"Test4", HWnd($sHWnd))
EndFunc
手机扫一扫
移动阅读更方便
你可能感兴趣的文章