Scott Blomquist, Tribal Librarian

The Case of the Disappearing Taskbar Notification Icons

Let's begin with a simple experiment that you can perform on your own computer:

  1. Count the number of icons in your Taskbar Notification Area, including any rarely used icons that Windows XP may have hidden under the little blue less-than button. The Taskbar Notification Area is that part of your Windows taskbar near the clock where lots of little icons go. [1]
  2. Kill explorer.exe. (If you're a command line type running Windows XP or later, “taskkill /im explorer.exe /f” will do the trick. If you're a GUI type, start Task Manager (Ctrl-Shift-Esc or your preferred method), choose explorer.exe and choose “End Process”.)
  3. Restart explorer.exe. (From a command line: “explorer”. From TaskMan: File->New task... “explorer”.)
  4. Once your taskbar is back, recount the number of icons in your notification area.

Chances are enormous that you have fewer notification icons than you started with. On my computer, the number went from 10 to 4! (Only Outlook, Windows Messenger, eTrust Anti-virus, and the Windows volume control survived. Lots of stuff didn't.)

Those icons will probably stay gone until you stop and restart the program responsible for each of them. Where did they go? Why did they go there?

It turns out that explorer.exe [2] loses all information about what icons were displayed there when it dies (and who can blame it for that?). It is up to each application that wishes to use the Taskbar Notification Area to remind explorer.exe's reincarnated self what it wanted displayed. The method by which your application properly gets notice of the reincarnation of explorer.exe (or, more specifically, the creation of the Taskbar) is described by MSDN Library as follows:

With Internet Explorer 4.0 and later, the Shell notifies applications that the taskbar has been created. When the taskbar is created, it registers a message with the TaskbarCreated string and then broadcasts this message to all top-level windows. When your taskbar application receives this message, it should assume that any taskbar icons it added have been removed and add them again. This feature generally applies only to services that are already running when the Shell begins execution. [Search for “Taskbar Creation Notification” at [3]]

This obscure little MSDN Library gem makes it sound like there's no reason a normal app should care about notification that the taskbar was just created, but as we just saw, real apps can be affected in a case where explorer.exe crashes or gets killed. While explorer crashes are not a terribly common occurrence in modern Windows releases, they are not unheard of. There is little reason not to get this behavior right considering that you can probably implement it by adding 6 or fewer lines to your window proc as shown in the example code in the above-linked MSDN Library article.

Excuse me while I restart so as to get back my other notification icons...

Footnotes
[1] You may know this as your “tray” or “systray” but Raymond Chen explains why you might think that, and why you would be wrong.
[2] The Windows process responsible for drawing much of the Windows desktop, including the taskbar.
[3] inline link to MSDN Library article

Published Friday, June 25, 2004 2:01 PM by TribalLibrarian

Comments

 

Ed said:

I also experience "missing tray icons" sometimes when I restart my machine (maybe 10% of the time). Usually it's Task Manager or my Volume icon.

Same culprit?
June 25, 2004 2:43 PM
 

Eric Cherng said:

Great tip! I occasionally get this problem and have always wondered what is happening under the covers.
June 25, 2004 3:56 PM
 

Scott Blomquist said:

Ed, it's possible that an application such as taskman could attempt to create its notification icon before the taskbar is ready. In that case, it wouldn't show up because taskman doesn't listen for the taskbar creation notification (which you can prove for yourself using the experiment outlined above).
June 25, 2004 9:24 PM
 

texas steve said:

IN addtion to missing my volume control, I also am missing my power icon almost always.
so how do I fix the problem?
steve
July 2, 2004 11:06 AM
New Comments to this post are disabled

This Blog

Syndication

Tags

No tags have been created or used yet.

News

These postings are provided "AS IS" with no warranties, and confer no rights.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker