System Delphi

Title: How to hide the clock in the system tray
function ShowTrayClock(bValue: Boolean) : Boolean;
var
TrayWnd, TrayNWnd, ClockWnd: HWND;
begin
TrayWnd := FindWindow('Shell_TrayWnd', nil);
TrayNWnd := FindWindowEx(TrayWnd, 0, 'TrayNotifyWnd', nil);
ClockWnd := FindWindowEx(TrayNWnd, 0, 'TrayClockWClass', nil);
Result := IsWindow(ClockWnd);
if Result then
begin
ShowWindow(ClockWnd, Ord(bValue));
PostMessage(ClockWnd, WM_PAINT, 0, 0);
end;
end;
Usage Example:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowTrayClock(Boolean(0));
end;