I've developed numerous utility programs that can be configured to run
automatically on startup and place themselves in an icon on the taskbar. My code
to do this looks something like the following:
// setup the struct
NotIcon.hIcon = Hicon; // icon was loaded from resources
NotIcon.cbSize = sizeof(NotIcon);
NotIcon.hWnd = MainForm->Handle;
NotIcon.uID = 0;
NotIcon.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE;
NotIcon.uCallbackMessage = ActivityMessage;
// add the icon to the taskbar
// Hide the main form
The problem I'm having is that each utility, when run by the user "manually" can
place itself in a taskbar icon fine, but.... when all of the utilities are
configured to autostart when windows, weird things are happening with the icons.
Most notably, I've noticed two problems:
1) Sometimes (randomly) the programs icon will not appear in the tray, even
though the program is visible as a process in the task manager.
2) I've had one instance of a "blank" icon showing up, which when right-clicked
is a duplicate of the "windows messenger" icon. I'm assuming this "blank" icon
is some broken version of one of my icons that was supposed to be there.
My question is -- has anyone experienced this problem before? Is there any
reasons why creating these icons at startup time would be causing a problem?