Solved

Hide ICON of an external appication on system tray

Posted on 2008-06-23
6
342 Views
Last Modified: 2011-10-19
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!
0
Comment
Question by:j88
6 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 21845426
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
0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 125 total points
ID: 21845800
Take a look at the SystemTray source code I provided in the following paq.

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_21976678.html

this will let you enumerate all the tray icons, and interact with them as well. In this case, you would just set the .Visible property for each to false. Let me know if you need assistance using the code.

Russell
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 21846268
Russel,
why do you make life so much easier

been looking for this too man !

thx
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 13

Expert Comment

by:ThievingSix
ID: 21847741
Goto madshi.net and get madcollection for the madKernel.

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

Makes this so much easier.
0
 

Author Comment

by:j88
ID: 21861818
Thank you very much Russell!
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 21862040
Very welcome.
Russell
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now