Page 2 of 2
Re: send systray icon notification in W7
Posted: Mon Oct 31, 2011 9:17 am
by wichtel
Why not send some notification text to your icon, Windows 7 then show the icon and we hide again once the notification has timed out.
You're a funny guy, because you just gave the answer to my initial question and seemingly didn't realize it.
THANKS A LOT @em_uk!!!
That is the piece of code I never got going for whatever reason.
Thanks again. Perfect.
Mike
Re: send systray icon notification in W7
Posted: Tue Nov 01, 2011 1:21 pm
by aaaaaaaargh
em_uk wrote:Why not send some notification text to your icon, Windows 7 then show the icon and we hide again once the notification has timed out.
You can also change the #NIIF_INFO and the end for different types of notifications eg : #NIIF_USER, #NIIF_WARNING, #NIIF_ERROR
Yes thanks, but that is just avoiding the issue, I didn't want a popup.
I really think PB needs a Library for Win7 specific UI stuff, systray, taskbar preview, jumplist stuff, PB is still stuck in the good old WinXP times...
Re: send systray icon notification in W7
Posted: Tue Nov 01, 2011 6:38 pm
by em_uk
Do you have an example of a program that can make its own icon appear without showing a notification?
Re: send systray icon notification in W7
Posted: Wed Nov 02, 2011 11:39 am
by aaaaaaaargh
em_uk wrote:Do you have an example of a program that can make its own icon appear without showing a notification?
The Windows Action Center and the "Safe device removal thingy" can do it, but I guess that they use some undocumented trick

Re: send systray icon notification in W7
Posted: Wed Nov 02, 2011 4:47 pm
by em_uk
I disagree. I don't see anything extra in the API that can do this, I doubt the OS would break its own rules.
I have just tested "Safely Remove Hardware" and it operates just like the other icons, if it can show the icon it will but if the area is full the icon will be hidden. The same as what happens when I add my application to the tray. This also applies to the Action Center (right now on my machine it is hidden).
What you are trying to do is override how the user has configured the options. Sure, you may be able to hack you icon to show, but if a user has explicitly told the tray to hide all icons apart notifications you honour that and shouldn't be thinking of ways to combat that choice.
The proper way to get the users attention is to show a notification, this what is documented and that is what you should be using.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Also see :
http://msdn.microsoft.com/en-us/library ... 11448.aspx
Specifically "Keeping users in control", "Guide lines" and "When to show"
Re: send systray icon notification in W7
Posted: Wed Nov 02, 2011 5:46 pm
by aaaaaaaargh
em_uk wrote:I disagree. I don't see anything extra in the API that can do this, I doubt the OS would break its own rules.
I have just tested "Safely Remove Hardware" and it operates just like the other icons, if it can show the icon it will but if the area is full the icon will be hidden. The same as what happens when I add my application to the tray. This also applies to the Action Center (right now on my machine it is hidden).
What you are trying to do is override how the user has configured the options. Sure, you may be able to hack you icon to show, but if a user has explicitly told the tray to hide all icons apart notifications you honour that and shouldn't be thinking of ways to combat that choice.
The proper way to get the users attention is to show a notification, this what is documented and that is what you should be using.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Also see :
http://msdn.microsoft.com/en-us/library ... 11448.aspx
Specifically "Keeping users in control", "Guide lines" and "When to show"
Ah well, I guess you are right, I'll just have to display a popup, thanks for the effort. While one the subject of Win7 "Guide Lines", any idea how one would I display a "Notification area flyout" and a "Thumbnail toolbar" as mentioned on the microsoft page?
Re: send systray icon notification in W7
Posted: Thu Nov 03, 2011 10:57 am
by em_uk
There is nothing special about the notification fly out, it's just a window with no title
http://stackoverflow.com/questions/7135 ... net-framew
You need to get the positioning right and create an activating/deactivating procedures.
Re: send systray icon notification in W7
Posted: Thu Nov 03, 2011 11:43 am
by aaaaaaaargh
Great, thank you! (I looks like nothing much changed in Win7 after all

)