Link to home
Start Free TrialLog in
Avatar of j88
j88

asked on

Hide ICON of an external appication on system tray

Hi Experts!
Here code 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;
-------------------------
i need hide icons of another application, for example: Internet Download Manager,...
Thanks!
Avatar of Geert G
Geert G
Flag of Belgium image

i imagine you would need to find the windows handle of the tray icon

use winsight that comes with Delphi
when you move the mouse over the tray icon you'll get messages for that window handle.

the next thing would be to find out the unique number for that icon, it's in the NOTIFYICONDATA

then you can send a msg NIM_DELETE for that icon
the application may of course update the icon after you deleted it


winsight.bmp
ASKER CERTIFIED SOLUTION
Avatar of Russell Libby
Russell Libby
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Russel,
why do you make life so much easier

been looking for this too man !

thx
Goto madshi.net and get madcollection for the madKernel.

http://help.madshi.net/TrayIcons.htm

Makes this so much easier.
Avatar of j88
j88

ASKER

Thank you very much Russell!
Very welcome.
Russell