NotificationId Property

Contains the numeric identifier associated with the notification.

Declaration

[C++]

HRESULT get_NotificationId(
    PNOTIFICATION_ID out_pNotificationId
);

HRESULT put_NotificationId(
    NOTIFICATION_ID in_notificationId
);

Property Value

out_pNotificationId

[out] A pointer into which the unique numeric identifier associated with this notification is written.

in_notificationId

[in] A unique numeric identifier to be associated with the notification.

This property is read/write.

Return Values

HRESULT value

Description

S_OK

Success

E_INVALIDARG

The parameter out_pNotificationId is NULL.

Remarks

Instances of a Component Object Model (COM) object that implement the ISideShowNotification interface, of which this property is a member, are created by the Windows SideShow gadget. After creation, the gadget sets the value of this property so that the Windows SideShow platform can retrieve it.

The notification identifier is important for the Windows SideShow platform to track because the Windows SideShow gadget may call the Revoke method of the ISideShowNotificationManager interface, passing the notification identifier to specify which notification is to be revoked.

Different notifications must be assigned unique values for this property. If two notifications are assigned the same identifier, the second notification sent to the associated Windows SideShow-compatible devices supersedes the first.

The default value of this property is zero (0).

Example

This example demonstrates how to set the value of the NotificationId Property property in an instance of the SideShowNotification class. Before setting the value of this property, Windows SideShow gadgets must create an instance of the SideShowNotification class, as demonstrated in the example for the ISideShowNotification interface. After setting the value of this property, and after setting other property values in the instance of the SideShowNotification class, Windows SideShow gadgets normally show the notification, as demonstrated by the example for the Show method of the ISideShowNotificationManager interface.

[C++]

HRESULT hr;

//
// Call put_NotificationId to write the NotificationId
// property, passing a constant notification identifier.
//
// Use a previously established pointer to the
// ISideShowNotification interface of an
// SideShowNotification object.
//
// Also check for failure.
//
hr = pISideShowNotification->put_NotificationId(99);

if (FAILED(hr))
{
    //
    // Handling of failures will be application-specific.
    //
    HandleFailure("put_NotificationId", hr);
}

Applies To

ISideShowNotification

See Also

Concepts

ISideShowNotificationManager