Notification icons in Vista. Popup UI?
Categories
I've just hit the msdn page for NOTIFYICONDATA, the structure passed through to Shell_NotifyIcon. It's been updated with Vista information. There have been a few changes, mostly quite dull, but check out this teaser for a new value for flags (red text emphasis mine):
NIF_SHOWTIP
Windows Vista and later: Use the standard ToolTip. When uVersion is set to NOTIFYICON_VERSION_4, the standard ToolTip is replaced by the application-drawn pop-up user interface (UI). If the application wants to show the standard tooltip in that case, regardless of whether the on-hover UI is showing, it can specify NIF_SHOWTIP to indicate the standard tooltip should still be shown. Note that the NIF_SHOWTIP flag is effective until the next call to Shell_NotifyIcon.
So, is this "application-drawn pop-up user interface" what's providing the fancy images for the battery, network and volume icons?
And if so, how do you actually draw it? That's not mentioned anywhere. (Well, it does say "application-drawn", so perhaps the question should be where? And how big? And do I have to do it all myself?)
One indication that this is what is being referred to is that these three icons don't actually appear in the normal notification area in Vista. Fire up Spy++ and it shows that these icons live in a window with a caption of "System Control Area" rather than the normal "Notification Area". This is mentioned in the NOTIFYICONDATA docs:
These icons are scaled down when they are displayed in the System Tray or System Control Area (SCA).
But that raises the question about how to add something to the SCA. Is that the guid is for in the struct?
PS. It's worth reading the remarks section for NOTIFYICONDATA; there's more going on with notification icons than you might first think. Balloon tips are queued. They display between 10 and 30 seconds, and this time doesn't start if you're not using your machine, or the screen saver is running. With Vista, they also don't appear when you're in in presentation mode. Shame you have to remember all of that when you need to roll your own.
#
RE: Notification icons in Vista. Popup UI?
posted by
Roger Lipscombe
on
10/15/2007 5:46:22 PM
:
You handle the NIN_POPUPSHOW message and create your own window (e.g. using vanilla CreateWindow). When you receive NIN_POPUPHIDE, you get rid of it again.
The "anchor coordinates" passed in wParam are a hint for where to put it. You can figure out the correct rectangle by playing with SHAppBarMessage to get the taskbar position.