The TrayIconBuster application was developed to be a small utility that will allow you to remove phantom icons from the Icon Tray .
A lot of programs install a NotifyIcon in the Icon Tray. Your system probably shows icons for Volume Control, Task Manager, Network Connections and many more. When a process installs a NotifyIcon and then exits without disposing of it, the icon remains present until you move the mouse pointer over it, making it suddenly disappear.
A lot of such phantom icons may pile up when developing a new application that installs a NotifyIcon but exits due to a fatal exception or a debug session being stopped in the middle. This utility will take care of Tray Icon clean-up automatically.
The Icon Tray
The Icon Tray is one of many windows managed by the Windows Explorer. It is in fact a toolbar holding a lot of buttons. Some of these buttons are hidden while others are visible. For each button, the Explorer holds a "process image name," which is the filename of the process that created the NotifyIcon.
There is no direct support for manipulating the Icon Tray in the .NET Framework, so we need a lot of P/Invoke stuff to call Win32 functions, first to locate the right toolbar and then to enumerate the buttons and get their file names, i.e. the filenames of the processes that created them. The final step is to delete the icons without filenames, i.e. the filename gets replaced by null when the process exits.
The program is simple. It does not show a Form; it simply shows yet another NotifyIcon. It offers a ContextMenu with three MenuItems: periodic run (runs every 5 seconds, checked by default), run now (for an immediate single run) and quit. When the TrayIconBuster attempts to remove phantom icons, it first locates the correct ListView.
Then it enumerates all icons a first time looking for its own icon (more on that later). Next it enumerates all icons again and removes the ones without a file name associated to them. There are basically four source files. Those are the main Form, the TrayIconBuster and two help classes: LP_Process and LP_Pinner.
TrayIconBuster 1.0 is a Freeware. Please read this article and discover
what exactly does Freeware mean.
Whether you're happy or not testing and using TrayIconBuster 1.0, be our guest and let's solve all the problems related to this software together. Feel free to use:
TrayIconBuster 1.0 comments section. No registration required! Please respect the general posting rules and do not abuse our system!
We strongly recommend you to use the following download manager, accelerator and duplicate file manager to avoid any downloading problems:NoClone
FamousWhy is not responsible for the content of the publisher's descriptions or user reviews and comments on this site.
All submitted content and ratings become the sole property of FamousWhy and may not be copied without permission.
We also reserve the rights to approve or refuse the written comments posted on FamousWhy within up to 48 hours.