Question

I´m working on a C++ application that creates an icon in notification area, with a baloon tip. When user clicks the baloon, the icon is being removed using Shell_NotifyIcon(NIM_DELETE, &nid), just as MSDN instructs to do.

The problem is that the notification icon leaves the tray, but it remains in the Notification Area Icons window (that window which opens when you click the Customize option in windows 7/8´s tray). Then, if the user restart the program, the icon will be duplicated many times as the program can be restarted, even if the computer is being restarted.

I googled about and I found out that removig some registry keys, the cache can be cleaned, but explorer.exe needs to be restarted... but this is not an option I want to put in pratice, for many reasons.

My questions are: - Have any of you guys seen this before? - Is there some alternative to Shell_NotifyIcon (assuming the possibility that the usage of this being the problem, once I´m not too much experienced in Winapi); - Is there any way to force "cache cleanup" in notification area window without restarting explorer.exe?

For those who can help, my gratitude in advance.

Was it helpful?

Solution

Indeed, IUserNotification2 worked great and the problem is solved.

I wrote a new notification class based on Notifu´s examples, using IUserNotification2, IQueryContinue and IUserNotificationCallback.

Thanks to all for helping.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top