Here are a few quick suggestions: 2 of your includes are not neededAdlibRegister calls a specified function at specified intervals, so instead of having the _GetTime_ function call itself once the script starts (and then get stuck in it), AdlibRegister will just go there once a secondCall _GetTime_ after the AdlibRegister so the clock has a chance to display before the first 1-second interval passesRun Tidy (CTRL-T) Please see the modified code below, anything not needed I just commented out rather than deleted. #include <WindowsConstants.au3>
;~ #include <GUIConstantsEx.au3>
;~ #include <misc.au3>
Global $popup = GUICreate('DesktopClock', 300, 50, @DesktopWidth + (-330), @DesktopHeight + (-100), $WS_POPUP)
GUISetBkColor(0x000000)
Global $clockLabel = GUICtrlCreateLabel('', 30, 5, 450, 30)
GUICtrlSetFont($clockLabel, 20, 0, 0, 'Segoe UI')
GUICtrlSetColor($clockLabel, 0x32cd32)
WinSetTrans($popup, "", 190)
GUISetState()
AdlibRegister("_GetTime_",1000)
_GetTime_()
While 1
Switch GUIGetMsg()
Case -3
ExitLoop
EndSwitch
;~ _GetTime_()
WEnd
Func _GetTime_()
GUICtrlSetData($clockLabel, 'Local time: ' & @HOUR & ":" & @MIN & ":" & @SEC)
;~ Sleep(1000)
;~ _GetTime_()
EndFunc ;==>_GetTime_
Ian