I'm fooling around with the below systray clock code (on Windows 10) and it's working fine, except for a little bug: at the start of every minute, the standard Windows clock briefly appears instead of my custom display. What would be a quick way to solve that?
Code: Select all
hwnd = FindWindow_("Shell_TrayWnd",#Null)
hwnd = FindWindowEx_(hwnd,#Null,"TrayNotifyWnd",#Null)
hwnd = FindWindowEx_(hwnd,#Null,"TrayClockWClass",#Null)
GetWindowRect_(hwnd,@Rect.rect)
Window_Width = Rect\right - Rect\left
Window_Height = Rect\bottom - Rect\Top - 4
OpenWindow(0,0,2,Window_Width,Window_Height+10,"Clock",#PB_Window_BorderLess)
; StickyWindow(0,1)
TextGadget(1,1,1,Window_Width,Window_Height,"")
SetParent_(WindowID(0),hwnd)
SetTimer_(WindowID(0), 0, 300, 0)
Repeat
Select WaitWindowEvent()
Case #WM_TIMER : SetGadgetText(1, "> "+ Hour(date()) +":" + Minute(date()) + ":" + second(date()))
EndSelect
Forever




