Share via


ISideShowNotificationManager::Show Method 

Retrieves and shows the specified notification.

Declaration

[C++]

HRESULT Show(
    ISideShowNotification *in_pINotification
);

Parameters

in_pINotification

[in] A pointer to an ISideShowNotification interface that the gadget instantiates, and that the Windows SideShow platform can use to retrieve the information associated with the notification, such as its numeric identifier, its title, its message, and so on.

Return Values

HRESULT value

Description

S_OK

Success.

S_FALSE

Either no Windows SideShow-compatible devices are associated with this gadget, or the notification cannot be shown on at least one connected device. The latter could occur if the string for the title or message is greater than 1024 characters.

E_INVALIDARG

The value of the in_pINotification parameter is NULL.

E_FAIL

The Windows SideShow platform is not properly initialized.

Remarks

The Windows SideShow platform uses the passed ISideShowNotification interface to retrieve the details of the notification from the Windows SideShow gadget. One of the properties available through this interface, the NotificationId property, should be set to a unique numeric value by the gadget. This value can be passed to the Revoke method to revoke that particular notification.

Some Windows SideShow-compatible devices may not support notifications. Calling this method does not affect such devices.

Example

This example demonstrates how Windows SideShow gadgets show notifications using the ISideShowNotificationManager::Show Method. Normally, notifications are shown after creating an instance of the SideShowNotification class, as demonstrated in the example for the ISideShowNotification interface, and after setting the properties that can be accessed through that interface, as demonstrated by the examples for its ExpirationTime, Image, Message, NotificationId, and Title properties.

[C++]

HRESULT hr;

//
// Call Show using previously established pointers to the
// ISideShowNotificationManager interface of the
// NotificationManager object and the ISideShowNotification
// interface of a SideShowNotification object.
//
// Also check for failure.
//
hr = pISideShowNotificationManager->Show(pISideShowNotification);

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

//
// Now that the notification has been shown, release the
// reference to the ISideShowNotification interface.
//
pISideShowNotification->Release();

Applies To

ISideShowNotificationManager

See Also

Concepts

ISideShowNotification
ISideShowNotificationManager::Revoke Method