MSDN’s documentation about Notifications and the Notification Area is pretty clear in the requirement for having an icon in the notification area in order to display a notification:
To display a notification, you must
have an icon in the notification
area. In certain cases, such as
Microsoft Communicator or battery
level, that icon will already be
present. In many other cases, however,
you will add an icon to the
notification area only as long as is
needed to show the notification.
Since I do not wish to add any icon to the notification area, I was thinking of perhaps “reusing” an existing one that is most likely to be there on a typical desktop. A good candidate may be the system clock.
My questions are:
- How do I find/enumerate the
NOTIFYICONDATA structure for the
system clock (AKA “Date and Time
Properties” when restored)? - Is there a better way of
accomplishing this (without adding
an icon)?
Shell_NotifyIcon uses IUserNotification under the hood. I played around with it and made a utility out of it. I heard of a visually impaired sysadmin who uses it to make his scripts screen reader compatible. It is command line, it does not have a message loop.
It is self aware, meaning that notifications sent to it will be queued (you have control over it). For that to work, I provided a IQueryContinue implementation. The project is in C++ and is open source, help yourself.
Here is the guts of it :