Download Tray42 Schmitt's World

Tray42: Using the Windows 95 System Tray in C

If you search AltaVista or InfoSeek for keywords such as Shell_NotifyIcon, systray, or "system tray", all that comes up are a few references to articles about Visual Basic.

- the Problem

Windows 95, Windows NT 4 and above, and other future versions of Windows have a little indentation at the far right (or bottom, if you're a freak and you orient your taskbar vertically) of the system taskbar. This area, called the system tray (or the systray), is a holding place for various notifications, including a clock and small icons.

When right-clicked, these icons will usually pop up a small menu from which the user can select to close the program that owns the icon, open up a settings dialog box, and other tasks. The programmer implements this using Shell_NotifyIcon and a NOTIFYICONDATA structure, defined in shellapi.h.

For a long time now, I've been searching for information on how to use this feature in plain Windows C. All of the references on the Internet are about VB4 and the tray, and I don't have a subscription to MSDN. Microsoft has put the MSDN Library online, but it doesn't work with Lynx, and uses Java applets, rendering my slow 486 unuseable (remember Netscape 2.02?).

It finally struck my pointy little head to just figure things out from the VB4 instructions. So I did, and you can download what I found. Everything that you need to know is explained in the source code.

Tray42 is a small app that demonstrates the use of the systray. The download is less than 10K ZIPped.

Other links of interest to the cheap Win32 programmer:

Return to 42 Utils Homepage

Return to Michael Smith's Retro Homepage

Michael Smith, <aa529@chebucto.ns.ca>