NOTIFYITEM

The NOTIFYITEM structure is used by methods of the ITrayNotify and INotificationCB interfaces to describe an item (icon) on the notification area of the taskbar.

Declaration

typedef struct tagNOTIFYITEM {
    PWSTR pszExeName;
    PWSTR pszTip;
    HICON hIcon;
    HWND hWnd;
    DWORD dwPreference;
    UINT uID;
    GUID guidItem;
} NOTIFYITEM;

The structure’s name is known from Microsoft’s symbol files. Names (and types) for the members are invented.

Members

The pszExeName member is the address of a pathname for the executable whose window owns the icon.

The pszTip member is the address of the icon’s tooltip text, such as specified by the szTip member of a NOTIFYICONDATA structure when Shell_NotifyIcon is called to add or modify a notification-area item.

The hIcon member is the icon handle.

The hWnd member is the handle to the window that owns the icon.

The dwPreference member is one of the following:

0x00 hide when inactive
0x01 always hide
0x02 always show

The uID member is the owning window’s integer ID for the icon.

The guidItem member is the GUID for the icon, else is GUID_NULL.

Use

To learn about notification-area items, implement an INotificationCB interface and pass it to the ITrayNotify interface’s RegisterCallback method. Your INotificationCB interface’s Notify method may then get called (back) to tell you of notification-area items. Each callback comes with a NOTIFYITEM structure to describe one item (and with a code to tell what is being done with that item).

For the ITrayNotify interface’s SetPreference method, you use a NOTIFYITEM structure to describe a notification-area item to the taskbar.