1. Home
  2. Computing & Technology
  3. Delphi Programming

Hide/Show Tray icons from Delphi code

By , About.com Guide

Here's how to show or hide the Windows Tray:

procedure TraySHOW
var
  TopWindow : HWND;
begin
  TopWindow:= FindWindow('Shell_TrayWnd', nil) ;
  TopWindow:= FindWindowEx(TopWindow,0, 'ReBarWindow32', nil) ;
  TopWindow:= FindWindowEx(TopWindow,0, 'SysPager', nil) ;
  ShowWindow( TopWindow,Sw_Show) ;
end;

procedure TrayHIDE
var
  TopWindow : HWND;
begin
  TopWindow:= FindWindow('Shell_TrayWnd', nil) ;
  TopWindow:= FindWindowEx(TopWindow,0, 'ReBarWindow32', nil) ;
  TopWindow:= FindWindowEx(TopWindow,0, 'SysPager', nil) ;
  ShowWindow( TopWindow,Sw_Hide) ;
end;
Need some more Tray info? Here are some articles:

System Tray Delphi application
Placing Delphi applications in the System Tray in easy steps. The perfect place form programs that are left running for long periods of time with no user interaction. Once you have placed a Delphi program's icon in the Tray, it's time to show a (customized) pop up menu near the icon and have the icon reflect the stat of your application - even animate it if you want to!

Delphi tips navigator:
» Disable mouse and keyboard
« TListBox with Multiple Columns

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2000 Delphi Tips
  7. Hide/Show Tray icons from Delphi code

©2009 About.com, a part of The New York Times Company.

All rights reserved.