Windows Vista - System Tray Changes


With Vista severel things regarding the system tray have changed again. This page will give an overview about which changes have been discovered yet...


Shell Service Objects

The registry key which is listing the shell service objects has changed.

New registry key:

  HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ShellServiceObjects\

Some important tray icons like the dynamic network connection icon and the volume control are no longer part of the system tray object (stobject.dll). Those are now seperated into own service objects.

{3BF043EF-A974-49B3-8322-B853CF1E5EC5} - Microsoft VolumeControlService.Class
{68ddbb56-9d1d-4fd9-89c5-c0da2a625392} - SystemTray object (stobject.dll) - again the GUID changed...
{7007ACCF-3202-11D1-AAD2-00805FC1270E} - Network Connections Tray

Which is the right GUID for the SystemTray object?

{35CEC8A3-2BE6-11D2-8773-92E220524153}
This is from Windows XP SP2. It's still valid and working in Vista - but not in the registry list by default...

{68ddbb56-9d1d-4fd9-89c5-c0da2a625392}
That's in the registry by default in Vista. For some reason the SharpE implementation doesn't start some icons, like batterymonitor. Is the SharpE implementation wrong, has something else changed with how service objects have to be loaded or the wrong GUID? Note that when the XP GUID is started the batterymonitor icon is working...

{730F6CDC-2C86-11D2-8773-92E220524153}
Emerge Desktop is using this GUID to start the tray... why? difference to the others? does it make the battery monitor work in vista? - This was extracted from my Windows XP SP2 machine. I'm not sure why it's different than the GUID mentioned above.


NOTIFYICONDATA Structure changes

http://msdn2.microsoft.com/en-us/library/ms538121.aspx

  • What are NIF_REALTIME and NIF_SHOWTIP flags used for? Can they be ignored?
  • Important changes to uCallbackMessage... Icon with Version NOTIFYICON_VERSION_4 (vista shell service icons...) must receive mouse event messages in a new way. See MSDN article... how to implement this properly?
  • new consts:
      // $0400 = WM_USER
      NIN_POPUPOPEN  = $0400 + 6;
      NIN_POPUPCLOSE = $0400 + 7;
      NIF_REALTIME   = $00000040;
      NIF_SHOWTIP    = $00000080;
    


uCallbackmessage implementation

Just a test how to implemented the uCallBackMessage changes properly... anything wrong about this:?
What about NIN_POPUPOPEN and NIN_POPUPCLOSE? When send those?

      // Tray Icon version 4 or higher?
      if (tempItem.BInfoFlags >= 4) then
      begin
        wp := MakeLParam(gx,gy);
        case msg of
          WM_LBUTTONUP,WM_LBUTTONDOWN,WM_LBUTTONDBLCLK,
          WM_MOUSEMOVE,WM_RBUTTONDOWN: lp := MakeLParam(msg,tempItem.uID);
          WM_RBUTTONUP: begin 
                          lp := MakeLParam(WM_RBUTTONUP,tempItem.uID);
                          PostMessage(tempItem.Wnd,tempItem.CallbackMessage,wp,lp);
                          lp := MakeLParam(WM_CONTEXTMENU,tempItem.uID);
                        end;
        end;
        PostMessage(tempItem.Wnd,tempItem.CallbackMessage,wp,lp);
      end else
      begin
        // old tray icon 
        postmessage(tempItem.Wnd,tempItem.CallbackMessage,tempItem.uID,msg);
      end;


Aston Shell

The only known shell which has proper Vista support at the moment is Aston Shell. But it's closed source an no infos to get how they do it... For the broken shell service icons where the right click menus are broken a window message log on what aston is doing looks like this:

DUN (Network Icon):
 - MouseMove:
    WM_USER + 100
    wparam: 0x040405c8 - wparam is always the screen coordinates
    lparam: 0xc0b10200 (message = 200)

  WM_USER + 36?! (sometime send - why? and what's this?)

 - LeftClick:
    WM_USER + 100
    lparam: 0xc0b10201 (message = 201)

Sound:
 - MouseMove:
    wparam: 0x040805eb
    lparam: 0x006420200 (message = 200)

 - Leftclick:
    wparam: 0x040f05e7
    lparam: 0x00640201 (message = 201)
    lparam: 0x00640202 (message = 202)
    lparam: 0x00640400 (message = 400) - why is it sending wm_user?

  - RightClick
    lparam: 204, 205, 7b  (juse the messages send)

200 = WM_MOUSEMOVE
201 = Left Button down
202 = Left Button up
204 = Right Button Down
205 = Right Button up
7b = WM_CONTEXTMENU

Possible values for 407:
TTM_RELAYEVENT (WM_USER+7)
SB_GETBORDERS (WM_USER+7)
TBM_SETRANGEMIN (WM_USER+7)

Possible values for 406:
TTM_NEWTOOLRECTA (WM_USER+6)
SB_GETPARTS (WM_USER+6)
TBM_SETRANGE (WM_USER+6)
RB_SETBANDINFOA (WM_USER+6)
SB_GETPARTS (WM_USER+6)
TB_MARKBUTTON (WM_USER+6)

this should be the 406, 407 stuff

  //version >= 5.01
  NIN_BALLOONSHOW = $0400 + 2;
  NIN_BALLOONHIDE = $0400 + 3;
  NIN_BALLOONTIMEOUT = $0400 + 4;
  NIN_BALLOONUSERCLICK = $0400 + 5;
  NIN_POPUPOPEN        = $0400 + 6;
  NIN_POPUPCLOSE       = $0400 + 7;

Attachments