点确认即运行某个程序,取消则退出程序,并在5秒过后自动取消如何写?
点确认即运行某个程序,取消则退出程序,并在5秒过后自动取消如何写?$VER=MsgBox(1,"询问","是否运行程序",5)
if $VER = 1 Then
;运行程序
EndIf
$VER=MsgBox(4,"询问","是否运行程序",5)
if $VER = 6 Then
;运行程序
EndIf
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 181, 87, 192, 114)
$Button1 = GUICtrlCreateButton("安装", 0, 32, 75, 25)
$Button2 = GUICtrlCreateButton("退出", 88, 32, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUISetState ()
Global $time = 5
AdlibRegister("_timer", 1000)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $button2
Exit
Case $button1
Case $GUI_EVENT_PRIMARYDOWN
AdlibUnRegister()
EndSwitch
If $time <= 0 Then
AdlibUnRegister()
Exit
EndIf
WEnd
AdlibUnRegister()
Exit
Func _timer()
$time -= 1
GUICtrlSetData($button2,"退出 (" & $time & ")")
If $time <= 0 Then AdlibUnRegister()
EndFunc ;==>_timer 本帖最后由 llwslc 于 2011-1-8 13:43 编辑
$money = MsgBox(1,"我点到什么东西了?","确认即运行IE,取消则不运行,并在5秒过后自动取消.", 5, 0x0)
Select
Case $money = 1
ShellExecute("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
EndSelect 话说高亮是怎么实现的... 话说高亮是怎么实现的...
llwslc 发表于 2011-1-8 13:44 http://www.autoitx.com/images/common/back.gif
把问号去掉,这里填写代码 [?au3]把问号去掉,这里填写代码
landays 发表于 2011-1-8 17:48 http://www.autoitx.com/images/common/back.gif
msgbox(1,"","了解!") msgbox() 本帖最后由 19377708 于 2011-1-12 17:42 编辑
MsgBox(0,","学习使用高亮") If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(33, "提示", "确定 运行 取消 退出!", 15)
Select
Case $iMsgBoxAnswer = 1 ;OK
Run ("D:\xx.exe")
Case $iMsgBoxAnswer = 2 ;Cancel
Case $iMsgBoxAnswer = -1 ;Timeout
EndSelect不知道LZ是否想需要这样的 简单实用!
页:
[1]