SHNOTIFICATIONDATA

The SHNOTIFICATIONDATA structure contains information about a notification.

Syntax

typedef struct _SHNOTIFICATIONDATA {
  DWORD cbStruct;
  DWORD dwID;
  SHNP npPriority;
  DWORD csDuration;
  HICON hicon;
  DWORD grfFlags;
  CLSID clsid;
  HWND hwndSink;
  LPCTSTR pszHTML;
  LPCTSTR pszTitle;
  LPARAM lParam;
} SHNOTIFICATIONDATA;

Members

  • cbStruct
    Size of the structure in bytes, for version checking. Set this to Sizeof(SHNOTIFICATIONDATA).
  • dwID
    Identifier for this particular notification.
  • npPriority
    The priority for the notification, given by the SHNP enumeration.
  • csDuration
    Duration of the notification in seconds. The usage depends on npPriority.
  • hicon
    Handle to the icon for the notification.
  • grfFlags
    Bitmask that defines the properties of the notification. See the table below for a listing of possible flag values.
  • clsid
    Unique identifier for the notification class.
  • hwndSink
    Handle to the window to receive command choices, such as dismissing the notification.
  • pszHTML
    HTML content for the message balloon.
  • pszTitle
    Optional title for the message balloon.
  • lParam
    User-defined parameter.

Remarks

When loading up the SHNOTIFICATIONDATA structure, you can specify either the notification class (clsid), the window to receive command choices (hwndSink), or both. If you specify the clsid, your COM component must implement IshellNotificationCallback. If you specify the clsid and an hwndSink, both COM and Window Message-style callbacks will be generated.

For notification priority SHNP_INFORM and above, do not display the notification bubble when it is initially added — the icon will display for the duration, then move to the system tray notification area. The user can view the bubble by activating the icon in the system tray notification area. If the shell notification flags SHNF_FORCEMESSAGE and SHNF_STRAIGHTTOTRAY are both used, the SHNF_FORCEMESSAGE flag overrides the SHNG_STRAIGHTTOTRAY flag.

The following table contains a list of shell notification flags that you can combine (using the logical OR) to construct the grfFlags member.

Flag Description
SHNF_STRAIGHTTOTRAY The message balloon is not displayed when it is initially added, even if npPriority is SHNP_INFORM. The icon appears immediately in the notification area. The user can view the message balloon by tapping the icon.
SHNF_CRITICAL The border and title of the message balloon are highlighted with colors that indicate the notification is critical.
SHNF_FORCEMESSAGE The message balloon always appears, even if npPriority is SHNP_ICONIC.
SHNF_DISPLAYON The device turns on (if it is off) for the notification.
SHNF_SILENT The notification is silent and does not cause the device to vibrate, regardless of other settings.

For an example showing how to use the SHNOTIFICATIONDATA structure, see The New Notification API in Pocket PC 2002 on MSDN.

Requirements

Pocket PC: Windows Mobile 2000 and later
OS Versions: Windows CE 3.0 and later
Header: Declared in aygshell.h

See Also

IShellNotificationCallback

SHNP

SHNotificationAdd

SHNotificationGetData

SHNotificationRemove

SHNotificationUpdate

Send feedback on this topic to the authors.

© 2005 Microsoft Corporation. All rights reserved.