Как скрыть часики в панели задач? |
Previous Top Next |
Убираем часики:
Code: |
procedure TForm1.Button1Click(Sender: TObject); var hn: HWnd; begin hn := FindWindowEx(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'TrayNotifyWnd', nil), 0, 'TrayClockWClass', nil); if hn <> 0 then ShowWindow(hn, SW_HIDE); //Bye,bye,Baby end; |
Снова показываем:
Code: |
procedure TForm1.Button2Click(Sender: TObject); var hn: HWnd; begin hn := FindWindowEx(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'TrayNotifyWnd', nil), 0, 'TrayClockWClass', nil); if hn <> 0 then ShowWindow(hn, SW_SHOW); //Hello, again end; |
©Drkb::01755
Взято из http://forum.sources.ru
Code: |
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;
// Example to hide they clock:
procedure TForm1.Button1Click(Sender: TObject); begin ShowTrayClock(Boolean(0)); end; |
©Drkb::01756
Взято с http://delphiworld.narod.ru