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

Hide/Show Tray icons from Delphi code

By Zarko Gajic, About.com

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

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming
About.com Special Features

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

Easy ways to connect two computers for networking purposes. 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.