#include <GuiConstantsEx.au3>
#include <StaticConstants.au3>
Global Enum $timer = 1001
$xb0x = GUICreate("提醒您", 180, 147, @DesktopWidth-300, 50)
$Labela = GUICtrlCreateLabel("系统将在", -20, 1, 106, 115, $SS_CENTER)
$Labelb = GUICtrlCreateLabel(0, 32, 16, 106, 115, $SS_CENTER)
GUICtrlSetFont(-1, 80, 400, 0, "宋体")
GUICtrlSetColor (-1, 0xff99ff)
$Labelc = GUICtrlCreateLabel("秒", 140, 90, 20, 115, $SS_CENTER)
$Labeld = GUICtrlCreateLabel("后强制关机!请尽快保存工作!", -10, 120, 200, 115, $SS_CENTER)
GUISetState(@SW_SHOW)
WinSetOnTop($xb0x,"",1)
$Hourtimer = DllCallbackRegister("_TimerFunc", "none", "")
$timer1 = _SetTimer($xb0x, $timer, 1000, DllCallbackGetPtr($Hourtimer))
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func _SetTimer($hWnd, $iIDEvent, $iElapse, $pTimerFunc = 0)
Local $iResult = DllCall("user32.dll", "int", "SetTimer", "hwnd", $hWnd, "int", $iIDEvent, "int", $iElapse, "ptr", $pTimerFunc)
If @error Then Return SetError(-1, -1, 0)
Return $iResult[0]
EndFunc
Func _TimerFunc()
$Nub=Number(GUICtrlRead($Labelb))+1
If $Nub=-1 Then
Shutdown(9)
Exit
EndIf
GUICtrlSetData($Labelb,$Nub)
Return
EndFunc
[ 本帖最后由 xb0x 于 2008-7-2 19:25 编辑 ] |