找回密码
 加入
搜索
查看: 2680|回复: 10

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

  [复制链接]
发表于 2011-1-7 19:04:21 | 显示全部楼层 |阅读模式
点确认即运行某个程序,取消则退出程序,并在5秒过后自动取消如何写?
发表于 2011-1-7 19:21:14 | 显示全部楼层

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

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



发表于 2011-1-7 19:22:50 | 显示全部楼层

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

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

发表于 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
发表于 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
发表于 2011-1-8 13:44:23 | 显示全部楼层
话说高亮是怎么实现的...
发表于 2011-1-8 17:48:33 | 显示全部楼层
话说高亮是怎么实现的...
llwslc 发表于 2011-1-8 13:44



    [au3]把问号去掉,这里填写代码[/au3?]
发表于 2011-1-8 18:02:12 | 显示全部楼层
[?au3]把问号去掉,这里填写代码[/au3?]
landays 发表于 2011-1-8 17:48


msgbox(1,"","了解!")
发表于 2011-1-9 09:53:51 | 显示全部楼层
msgbox()
发表于 2011-1-12 17:38:37 | 显示全部楼层
本帖最后由 19377708 于 2011-1-12 17:42 编辑

MsgBox(0,","学习使用高亮")
发表于 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是否想需要这样的 简单实用!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 16:18 , Processed in 0.107180 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表