找回密码
 加入
搜索
查看: 8339|回复: 38

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

[复制链接]
发表于 2009-9-8 22:23:53 | 显示全部楼层 |阅读模式
本帖最后由 fyhwaijxnt78 于 2009-9-9 00:16 编辑

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $time = 30
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("倒计时测试窗口", 350, 172, 193, 125)
$Label1 = GUICtrlCreateLabel("30秒后将进入主程序!", 56, 32, 232, 28)
GUICtrlSetFont(-1, 18, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
$Button1 = GUICtrlCreateButton("确定(&Y)", 53, 128, 73, 25, 0)
$Button2 = GUICtrlCreateButton("退出(&X)", 210, 128, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibEnable("_timer", 1000)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
   Case $GUI_EVENT_CLOSE, $Button2
    Exit
   Case $Button1
    ExitLoop
EndSwitch
If $time <= 0 Then ExitLoop
WEnd
main()
Exit

Func _timer()
$time -= 1
GUICtrlSetData($Label1, $time & "秒后将进入主程序!")
GUICtrlSetData($Progress1, (30 - $time) / 0.3)
If $time <= 0 Then AdlibDisable()
EndFunc   ;==>_timer

Func main()
MsgBox(0, 'test', '倒计时结束,进入主程序.', 10)
;以下为主程序
EndFunc   ;==>main

本帖子中包含更多资源

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

×
 楼主| 发表于 2009-9-8 22:24:56 | 显示全部楼层
这个怎么加上去!
Func mr()
    GUIDelete($Form1)
        run("C:\拖拉机\拖拉机.EXE")
EndFunc
发表于 2009-9-8 22:26:52 | 显示全部楼层
你的意思是把 ;以下为主程序 换成 Func mr() 的功能?
 楼主| 发表于 2009-9-8 22:35:02 | 显示全部楼层
本帖最后由 fyhwaijxnt78 于 2009-9-8 22:36 编辑

我的意思就是30秒后打开个程序!但这个AU3,30秒后打开的是(按确定也是) 倒计时结束,进入主程序。并有正进进入要打开的程序,这只是个提示!

要把这个改下
Func main()
MsgBox(0, 'test', '倒计时结束,进入主程序.', 10)
;以下为主程序
EndFunc   ;==>main


谢谢!
发表于 2009-9-8 22:37:29 | 显示全部楼层
没搞懂你的意思,直接Run不行吗?

Func main()
MsgBox(0, 'test', '倒计时结束,进入主程序.', 10)
run("C:\拖拉机\拖拉机.EXE")
EndFunc   ;==>main
 楼主| 发表于 2009-9-8 22:40:16 | 显示全部楼层
可以,只要能在30秒后或点确定,能打开一个程序就行了!

你看看怎么改,谢谢了!
发表于 2009-9-8 22:40:49 | 显示全部楼层
LS不是已经改了吗?
 楼主| 发表于 2009-9-8 22:42:55 | 显示全部楼层
没看呀,请问在哪??
发表于 2009-9-8 22:43:54 | 显示全部楼层
Func main()
MsgBox(0, 'test', '倒计时结束,进入主程序.', 10)
run("C:\拖拉机\拖拉机.EXE")
EndFunc   ;==>main


↑↑↑↑这个不是吗?↑↑↑

评分

参与人数 1金钱 +5 收起 理由
fyhwaijxnt78 + 5 可以了,谢谢了!

查看全部评分

发表于 2009-9-8 22:45:45 | 显示全部楼层
我认认真真把楼主的话读了好几遍,实在很难理解楼主的意思。
 楼主| 发表于 2009-9-8 22:46:16 | 显示全部楼层
Func main()
MsgBox(0, 'test', '倒计时结束,进入主程序.', 10)
run("C:\拖拉机\拖拉机.EXE")
EndFunc   ;==>main


↑↑↑↑这个不是吗?↑↑↑
afan 发表于 2009-9-8 22:43

可以了,谢谢了!
发表于 2009-9-8 22:47:37 | 显示全部楼层
Func main()
MsgBox(0, 'test', '倒计时结束,进入主程序.', 10)
run("C:\拖拉机\拖拉机.EXE")
EndFunc   ;==>main


↑↑↑↑这个不是吗?↑↑↑
afan 发表于 2009-9-8 22:43


呵呵!呵呵!呵呵!

评分

参与人数 1金钱 +5 收起 理由
fyhwaijxnt78 + 5 Func main() run(&quot;C:\拖拉机\拖拉机.EX ...

查看全部评分

 楼主| 发表于 2009-9-8 22:50:52 | 显示全部楼层
本帖最后由 fyhwaijxnt78 于 2009-9-8 22:56 编辑
呵呵!呵呵!呵呵!
水木子 发表于 2009-9-8 22:47


Func main()
run("C:\拖拉机\拖拉机.EXE")
EndFunc   ;==>main

可以了!谢谢!

请问时间改成20秒(要慢慢来的,它一下就跑到50%),怎么改?
发表于 2009-9-8 22:55:34 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $time = 20
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("倒计时测试窗口", 350, 172, 193, 125)
$Label1 = GUICtrlCreateLabel("30秒后将进入主程序!", 56, 32, 232, 28)
GUICtrlSetFont(-1, 18, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
$Button1 = GUICtrlCreateButton("确定(&Y)", 53, 128, 73, 25, 0)
$Button2 = GUICtrlCreateButton("退出(&X)", 210, 128, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibEnable("_timer", 1000)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE, $Button2
                        Exit
                Case $Button1
                        ExitLoop
        EndSwitch
        If $time <= 0 Then ExitLoop
WEnd
main()
Exit

Func _timer()
        $time -= 1
        GUICtrlSetData($Label1, $time & "秒后将进入主程序!")
        GUICtrlSetData($Progress1, (20 - $time) / 20 * 100)
        If $time <= 0 Then AdlibDisable()
EndFunc   ;==>_timer

Func main()
        run("C:\拖拉机\拖拉机.EXE")
EndFunc   ;==>main
发表于 2009-9-8 22:57:59 | 显示全部楼层
太快了吧!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 16:18 , Processed in 0.092133 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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