_ClickMsgBox("测试","3秒后点击确定,取消窗口","Button1",3)
MsgBox(0,"测试","3秒后点击确定,取消窗口")
Func _ClickMsgBox($MBTitle, $MBText,$MBButton,$MBTimeOut)
Local $file = FileOpen(EnvGet("temp") & "\ClickMB.au3", 2)
If $file = -1 Then Return
Local $line1 = 'WinWait("' & $MBTitle & '", "' & $MBText & '"'&')'
Local $line2 = 'Sleep("'&$MBTimeOut * 1000&'"'&')'
Local $line3 = 'Controlclick("' & $MBTitle & '", "' & $MBText & '"' & ', "'&$MBButton&'"'&')'
FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3)
FileClose($file)
Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\ClickMB.au3")
EndFunc
|