回复 15# zym3138
你加上不就行了嘛,这个都还要‘这样更好了’…………
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MenuConstants.au3>
#include <WinAPI.au3>
$hgui = GUICreate("Timer show", 285, 80, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP), BitOR($WS_EX_LAYERED,$WS_EX_TOPMOST), WinGetHandle(AutoItWinGetTitle()))
GUISetFont(50, 800)
$nHourLabel = GUICtrlCreateLabel('', 0, 0, 100, 80)
GUIctrlSetBkColor(-1,0xFFFFFF)
$nMinLabel = GUICtrlCreateLabel('', 100, 0, 100, 80)
GUIctrlSetBkColor(-1,0xFFFFFF)
$nSecALabel = GUICtrlCreateLabel('', 200, 0, 40, 80)
GUIctrlSetBkColor(-1,0xFFFFFF)
$nSecBLabel = GUICtrlCreateLabel('', 235, 0, 50, 80)
GUIctrlSetBkColor(-1,0xFFFFFF)
GUISetState(@SW_SHOW, $hgui)
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xFFFFFF, 255)
AdlibRegister("_Timer", 1000)
While True
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_PRIMARYDOWN
_SendMessage($hGUI, $WM_SYSCOMMAND, $SC_MOVE + $HTCAPTION, 0)
EndSwitch
WEnd
Func _Timer()
Local Static $iSecA, $iSecB, $iMin, $iHour
If StringTrimRight(@SEC, 1) <> $iSecA Then
GUICtrlSetData($nSecALabel, StringTrimRight(@SEC, 1))
$iSecA = StringTrimRight(@SEC, 1)
EndIf
If StringTrimLeft(@SEC, 1) <> $iSecB Then
GUICtrlSetData($nSecBLabel, StringTrimLeft(@SEC, 1))
$iSecB = StringTrimLeft(@SEC, 1)
EndIf
If @MIN <> $iMin Then
GUICtrlSetData($nMinLabel, @MIN & ':')
$iMin = @MIN
EndIf
If @HOUR <> $iHour Then
GUICtrlSetData($nHourLabel, @HOUR & ':')
$iHour = @HOUR
EndIf
EndFunc
|