IDeskTray

The IDeskTray methods are (as ordered in the virtual function table after the IUnknown methods):

Offset Method
0x0C AppBarGetState
0x10 GetTrayWindow
0x14 SetDesktopWindow
0x18 SetVar

with prototypes:

UINT AppBarGetState (VOID);
HRESULT GetTrayWindow (HWND *);
HRESULT SetDesktopWindow (HWND);
HRESULT SetVar (INT, ULONG);

Implementation

The only known use of the IDeskTray interface is for the SHELL32.DLL function SHCreateDesktop, which takes an IDeskTray pointer as its one argument. The interface is of course implemented in EXPLORER but would also be implemented in any program that attempts to replace EXPLORER (presumably to improve on it as the shell’s front end) while still having SHELL32 present the familiar desktop.

The implementation in EXPLORER is notable for having its QueryInterface method always fail, which is why no IID is known for the interface.

Availability

The IDeskTray interface is supported by EXPLORER and SHELL32 in version 5.00 and higher.

Though this interface dates from 1999, it was still not documented by Microsoft as late as the January 2007 edition of the Windows Vista Software Development Kit (SDK).