zjppaa 发表于 2011-1-7 19:04:21

点确认即运行某个程序,取消则退出程序,并在5秒过后自动取消如何写?

点确认即运行某个程序,取消则退出程序,并在5秒过后自动取消如何写?

都市浪子666 发表于 2011-1-7 19:21:14


$VER=MsgBox(1,"询问","是否运行程序",5)

if $VER = 1 Then
        ;运行程序
       
EndIf



都市浪子666 发表于 2011-1-7 19:22:50


$VER=MsgBox(4,"询问","是否运行程序",5)

if $VER = 6 Then
        ;运行程序
       
EndIf

qq82015930 发表于 2011-1-7 19:40:57

#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:41:56

本帖最后由 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:23

话说高亮是怎么实现的...

landays 发表于 2011-1-8 17:48:33

话说高亮是怎么实现的...
llwslc 发表于 2011-1-8 13:44 http://www.autoitx.com/images/common/back.gif


    把问号去掉,这里填写代码

llwslc 发表于 2011-1-8 18:02:12

[?au3]把问号去掉,这里填写代码
landays 发表于 2011-1-8 17:48 http://www.autoitx.com/images/common/back.gif

msgbox(1,"","了解!")

ghl781258 发表于 2011-1-9 09:53:51

msgbox()

19377708 发表于 2011-1-12 17:38:37

本帖最后由 19377708 于 2011-1-12 17:42 编辑

MsgBox(0,","学习使用高亮")

renren 发表于 2011-1-13 01:02:31

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]
查看完整版本: 点确认即运行某个程序,取消则退出程序,并在5秒过后自动取消如何写?