回复 4# dnvplj
因為我的做法是 取秒數相減 這是偷懶的方法
真的 要正確秒數 要設定 定時的方法 處理
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("MustDeclareVars", 1)
#Region ### START Koda GUI section ### Form=
Global $gu_Form2 = GUICreate("", 392, 104, -1, -1)
Global $gu_Group1 = GUICtrlCreateGroup("", 8, 8, 377, 89)
Global $gu_Input1 = GUICtrlCreateInput("", 16, 24, 287, 21)
Global $gu_Button1 = GUICtrlCreateButton("? ?", 313, 21, 65, 25)
Global $gu_Button2 = GUICtrlCreateButton("? 行", 240, 56, 65, 30)
Global $gu_Button3 = GUICtrlCreateButton("退 出", 313, 56, 65, 30)
Global $gu_Label1 = GUICtrlCreateLabel("15秒后退出,否??手???", 55, 62, 180, 20)
GUICtrlSetFont(-1, 11, 800, 0, "MS Sans Serif")
Global $gu_Label1_1 = GUICtrlCreateLabel(" 0 ", 16, 62, 25, 25)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister ( "TIME" , 1000 )
Global $T=0
_Main()
Exit
Func _Main()
Local $nMsg
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $gu_Button1
Local $gu_Inputa1
$gu_Inputa1 = FileOpenDialog('??文件', '', 'exe文件(*.exe)', 1, '', $gu_Form2)
GUICtrlSetData($gu_Input1, $gu_Inputa1)
Case $gu_Button2
GUISetState(@SW_HIDE, $gu_Form2)
RunWait("" & GUICtrlRead($gu_Input1))
Exit
Case $gu_Button3
Exit
EndSwitch
WEnd
EndFunc ;==>_Main
Func TIME()
IF $T >15 THEN Exit
If $T =0 Then
GUICtrlSetData($gu_Label1_1, $T )
Else
GUICtrlSetData($gu_Label1_1, StringFormat('%02d',$T) )
EndIf
$T=$T+1
EndFunc
|