I am attempting to create my own shell and am now working on the system tray. I would like to know if there is a way to determine the system tray icon information (ie: If there is an icon, right and left click actions/menus, etc) for open applications or how I can catch the creation/deletion messages for these icons?
I have seen examples of how I can pull the current system tray icons, but this will not work seeing as when my program is complete explorer will not be open.
Through experimentation with Spy++ I have determined that the System Tray receives a TB_INSERTBUTTON
message, so my thought was if I could catch this message and determine if it was supposed to go to the system tray I could process it myself.
Using Spy++ I monitored an application that I know creates a tray icon as it opens but found no such message. My guess is, it sends a different message to windows which then processes it and then sends the TB_INSERTBUTTON
message to the System Tray.
I know that this is some how possible because I have used other custom shells that contain a System Tray, but I am stuck on how to go about doing it. I do understand that I will either need to use Interop, or maybe write an unmanaged DLL to handle this.
Okay, from further research I have decided that what would most likely be the best way of doing this would be to catch the messages NIM_ADD and such that are for the System Tray but I have no idea of how to accomplish this.