Code: Alles auswählen
;-(c) Robert Herter
;Rect Structure
Structure fg
left.l
top.l
rigth.l
bottom.l
EndStructure
Dim MyClock.fg(1)
;-Systray
hwnd=FindWindowEx_(FindWindow_("Shell_TrayWnd", ""), 0, "TrayNotifyWnd", "")
;-Child Window
GetWindowRect_(hwnd,@MyClock(0))
OpenWindow(1,(MyClock(0)\rigth-MyClock(0)\left-40),0,40,24,"",#PB_Window_BorderLess|#PB_Window_Invisible)
;-Font erstellen
FontID1=LoadFont(0,"Arial",9,#PB_Font_Bold)
;-Gadget und Einstellungen für die Uhr
CreateGadgetList(WindowID(1))
TextGadget(10,4,3,40,25,"")
SetGadgetColor(10,#PB_Gadget_BackColor,RGB($25,$69,$DA))
SetGadgetColor(10,#PB_Gadget_FrontColor,RGB($FF,$FF,$FF))
SetGadgetFont(10,FontID1)
SetWindowColor(1,RGB($25,$69,$DA))
SetParent_(WindowID(1),hwnd);-Eltern fenster setzen
ShowWindow_(WindowID(1),1);-Fenster anzeigen
;-Thread für die Uhr
Procedure mythread()
Repeat
If (ElapsedMilliseconds()-refreshtimer) > 1000 ; 1 Sekunde
SetGadgetText(10, FormatDate("%hh:%ii", Date()) )
refreshtimer=ElapsedMilliseconds()
EndIf
ForEver
EndProcedure
;------
CreateThread(@mythread(),0);-Thread Starten
;-Hauptschleife
Repeat
Event=WaitWindowEvent()
EventType=EventType()
Until EventType=#PB_EventType_RightClick
End
;---
Wenn die Taskleiste rechts oder links ist, dann funktioniert es im moment noch nicht!
Im moment nur für den Klassischen Skin.