找回密码
 加入
搜索
查看: 2580|回复: 4

[GUI管理] 延时启动程序,GUI框架是弄好了。希望大手给我指点编写的思路

[复制链接]
发表于 2013-10-3 11:39:13 | 显示全部楼层 |阅读模式
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("程序定时运行", 250, 222, 192, 124)
$timemin = GUICtrlCreateInput("20", 104, 48, 41, 21)
$DDlj = GUICtrlCreateInput("", 8, 88, 161, 21)
$DDButton = GUICtrlCreateButton("1路径", 184, 88, 57, 25)
$Label1 = GUICtrlCreateLabel("定时时间", 8, 16, 220, 25)
$timehour = GUICtrlCreateInput("00", 8, 48, 41, 21)
$Label2 = GUICtrlCreateLabel("小时", 72, 53, 28, 17)
$Label3 = GUICtrlCreateLabel("分钟", 152, 53, 36, 17)
$DKlj = GUICtrlCreateInput("", 8, 124, 161, 21)
$DKButton2 = GUICtrlCreateButton("2路径", 184, 124, 57, 25)
$start = GUICtrlCreateButton("开始", 0, 183, 103, 33)
$cancel = GUICtrlCreateButton("取消", 129, 183, 103, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
  $nMsg = GUIGetMsg()
  Switch $nMsg
        Case $GUI_EVENT_CLOSE   
                        Exit
       
  EndSwitch
WEnd

GUI写好了,我想定时运行两个自动安装的程序。时间自己设定,两个程序的路径自己设定。自动安装的我会编写。延时的部分看到论坛里面说会占用CPU什么的不知道用什么函数好。希望高手给知道一下
发表于 2013-10-3 11:45:10 | 显示全部楼层
回复 1# wyw5125521

一般用 AdlibRegister 搞个自定义函数来检测“定时”; 要求精确度不高的,可以半分钟或几分钟检测一次。这会占什么CPU呢?!
发表于 2013-10-4 22:34:27 | 显示全部楼层
循环加判断时间加sleep,不会对CPU产生大的影响,比如
While 1
        If @HOUR = "19" And @MIN = "00" And @SEC = "00" Then
                xxx
                xxxx
                xxxxx
                ExitLoop
        EndIf
        Sleep(100)
WEnd
 楼主| 发表于 2013-10-6 14:52:38 | 显示全部楼层
本帖最后由 wyw5125521 于 2013-10-6 14:58 编辑

回复 3# xms77


    谢谢咯,我先照这个思路来看一下。后续我再把我自己编的放上来
 楼主| 发表于 2013-10-6 14:53:25 | 显示全部楼层
回复 2# user3000


    谢谢,后续把我自己测试的放上来。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-4 05:02 , Processed in 0.076051 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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