找回密码
 加入
搜索
楼主: fyhwaijxnt78

帮改下(请问这个怎么倒计时执行指定的程序?)

[复制链接]
发表于 2009-9-8 23:42:18 | 显示全部楼层
我下了,各位早点哦
发表于 2009-9-8 23:44:01 | 显示全部楼层
31# kn007


早点..........
发表于 2009-9-8 23:46:25 | 显示全部楼层
嘿嘿,你也是 ,88
发表于 2009-9-9 00:14:05 | 显示全部楼层
本帖最后由 afan 于 2009-9-9 00:15 编辑
  1. #include <GUIConstantsEx.au3>

  2. Dim $timez = 20, $time = $timez
  3. $Form1 = GUICreate("倒计时测试窗口", 350, 172, 193, 125)
  4. $Label1 = GUICtrlCreateLabel($time & "秒后将安装拖拉机,请选择!", 20, 32, 310, 28, 0x0002)
  5. GUICtrlSetFont(-1, 16, 400, 0, "楷体_GB2312")
  6. $Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
  7. $Button1 = GUICtrlCreateButton("立即安装(&Y)", 53, 128, 90, 25)
  8. $Button2 = GUICtrlCreateButton("退出安装(&X)", 210, 128, 90, 25)
  9. GUISetState()
  10. AdlibEnable("_timer", 1000)

  11. While 1
  12.         $nMsg = GUIGetMsg()
  13.         Switch $nMsg
  14.                 Case $GUI_EVENT_CLOSE, $Button2
  15.                         Exit
  16.                 Case $Button1
  17.                         ExitLoop
  18.         EndSwitch
  19.         If $time <= 0 Then ExitLoop (Sleep(1000))
  20. WEnd

  21. main()
  22. Exit

  23. Func _timer()
  24.         $time -= 1
  25.         GUICtrlSetData($Label1, $time & "秒后将安装拖拉机,请选择!")
  26.         GUICtrlSetData($Progress1, ($timez - $time) / $timez * 100)
  27.         If $time <= 0 Then Return (GUICtrlSetData($Label1, "现在开始安装拖拉机   ")) & (AdlibDisable())
  28. EndFunc   ;==>_timer

  29. Func main()
  30.         run("C:\拖拉机\拖拉机.EXE")
  31. EndFunc   ;==>main
复制代码
修改得人性化了点,另外倒计时时间只需修改前面的 Dim $timez = 20 ,20秒改成其它值即可,其余处均不用调整。
 楼主| 发表于 2009-9-9 10:54:51 | 显示全部楼层
#include

Dim $timez = 20, $time = $timez
$Form1 = GUICreate("倒计时测试窗口", 350, 172, 193, 125)
$Label1 = GUICtrlCreateLabel($time & "秒后将安装拖拉机,请选择!", 20, 32, 310, 28, 0x0002)
GUI ...
afan 发表于 2009-9-9 00:14


谢谢,很好!
我自己已改成二行了!
发表于 2010-12-30 09:51:55 | 显示全部楼层
我来试一下看
发表于 2015-3-11 14:04:25 | 显示全部楼层
回复 34# afan
版主您好:
该代码一运行就出错呢,请指教。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2015-3-11 15:54:35 | 显示全部楼层
回复 37# dnvplj


    AdlibRegister
    AdlibUnRegister
发表于 2015-3-11 16:11:43 | 显示全部楼层
本帖最后由 dnvplj 于 2015-3-11 16:19 编辑

回复 38# zcx880517
感谢回复,明白了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2026-9-27 22:14 , Processed in 0.288171 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2026 Discuz! Team.

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