#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
;Global $Sec = 0
;Global $Min = 1
Local $sec=0,$min=1
$mainwindow = GUICreate("倒计时 ", 162, 82, 400, 300, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
$Label = GUICtrlCreateLabel("标签", 0, 0, 162, 82, $SS_BLACKFRAME, $GUI_WS_EX_PARENTDRAG) ;通过右键菜单退出-拖拽
;FileInstall("tu.jpg", @TempDir & "") ;编译图片
;$Pic1 = GUICtrlCreatePic(@TempDir & "\tu.jpg", 0, 0, 162, 82)
$FontMin = GUICtrlCreateLabel(StringFormat('%02s', $Min), 22, 2, 48, 39)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0xc24343)
GUICtrlSetFont(-1, 34, 400, 0, "@黑体")
$FontD = GUICtrlCreateLabel(":", 68, 2, 48, 39)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0xc24343)
GUICtrlSetFont(-1, 34, 400, 0, "@黑体")
$FontSec = GUICtrlCreateLabel(StringFormat('%02s', $Sec) & ":", 90, 2, 48, 39)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0xc24343)
GUICtrlSetFont(-1, 34, 400, 0, "@黑体")
$contextmenu = GUICtrlCreateContextMenu(3)
$Start = GUICtrlCreateMenuItem("开始", $contextmenu)
$Abort = GUICtrlCreateMenuItem("关于", $contextmenu)
GUICtrlCreateMenuItem("", $contextmenu)
$infoitem = GUICtrlCreateMenuItem("退出", $contextmenu)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3, $infoitem ; 退出
infoitem()
Case $Start
$sec=0
$Min=1
AdlibRegister("_timer", 1000)
EndSwitch
WEnd
Func _timer()
If $Sec = 0 And $Min = 0 Then
AdlibUnRegister("_timer");这个我也不知道有什么用
Else
If $Sec <= 0 Then
$Sec = 60 + $Sec
$Min -= 1
EndIf
$Sec -= 1
GUICtrlSetData($FontMin, StringFormat('%02s', $Min))
GUICtrlSetData($FontSec, StringFormat('%02s', $Sec) & ":")
EndIf
EndFunc ;==>_timer
Func infoitem()
FileDelete(@TempDir & "\tu.jpg") ;删除图片
Exit
EndFunc ;==>infoitem