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!
Here code hide the clock in the system tray
--------------------
function ShowTrayClock(bValue: Boolean) : Boolean;
var
TrayWnd, TrayNWnd, ClockWnd: HWND;
begin
TrayWnd := FindWindow('Shell_TrayWnd'
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!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Russel,
why do you make life so much easier
been looking for this too man !
thx
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.
http://help.madshi.net/TrayIcons.htm
Makes this so much easier.
ASKER
Thank you very much Russell!
Very welcome.
Russell
Russell
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