好像 还是有点问题啊 定义的 和显示的 时间不一样啊
源码
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <date.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("定时器", 265, 127, 230, 160)
$Pic1 = GUICtrlCreatePic("D:\CPU的文档\男孩.JPG", 0, 0, 131, 126, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Group1 = GUICtrlCreateGroup("编辑区", 135, 0, 126, 126)
$Button1 = GUICtrlCreateButton("确定", 155, 100, 86, 21, 0)
$radio1 = GUICtrlCreateRadio("关机", 145, 20, 43, 17)
$radio2 = GUICtrlCreateRadio("待机", 205, 20, 51, 16)
GUICtrlSetState($radio1, $GUI_CHECKED)
GUICtrlCreateInput("", 140, 55, 31, 21)
$Label1 = GUICtrlCreateLabel("时", 180, 55, 16, 17)
GUICtrlCreateInput("", 205, 55, 31, 21)
$Label2 = GUICtrlCreateLabel("分", 240, 55, 16, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### START Koda GUI section ### Form=
Dim $Label1 , $Label2
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
times()
Exit
EndSwitch
WEnd
Func times()
Global $Sec, $Min, $Hour, $Time
$StartTicks = _TimeToTicks(@HOUR,@MIN,@SEC)
$EndTicks = $StartTicks + _TimeToTicks($Label1,$Label2,0);延时1分,可使用变量
;$EndTicks = $StartTicks + _TimeToTicks(0,8,8);延时8分8秒
_TicksToTime($EndTicks,$Hour,$Min,$Sec)
MsgBox(262144,'' , '关机时间为 ' & StringFormat("%02i:%02i:%02i", $Hour, $Min, $Sec))
EndFunc ;==>times |