Partager via


ISideShowNotification 

Windows SideShow gadgets instantiate Component Object Model (COM) objects that implement the ISideShowNotification interface. Calling ISideShowNotification enables the Windows SideShow platform to retrieve the various parts of a notification for display on the associated Windows SideShow devices that support notifications.

Members

Property Description

ExpirationTime

Contains the expiration date and time of a notification as a SYSTEMTIME structure.

Image

Contains an icon associated with a notification.

Message

Contains the main textual portion of a notification.

NotificationId

Contains the numeric identifier associated with the notification.

Title

Contains the title string of a notification, if a title exists.

Remarks

When a Windows SideShow gadget calls the Show method of the ISideShowNotificationManager interface, it passes a pointer to an instance of an object that implements this interface. In response to the call to the Show method, the Windows SideShow platform calls the properties of the latter interface to retrieve:

  • The notification title, if any.
  • The notification message.
  • The notification identifier.
  • The notification icon, if any.
  • The expiration time of the notification, if any.

Although this interface is implemented by the Windows SideShow platform, it is used in a way that is very similar to the client-implemented ISideShowContent interface. Instances of objects implementing this interface are created by Windows SideShow gadgets and a pointer to this interface of such objects are passed to the Show method of the ISideShowNotificationManager interface.

Windows SideShow gadgets create COM objects that implement this interface by calling CoCreateInstance with the class identifier CLSID_SideShowNotification.

Example

This example demonstrates how to create an instance of the SideShowNotification class and retrieve a pointer to its ISideShowNotification interface.

[C++]

HRESULT hr;
ISideShowNotification* pISideShowNotification;

//
// Create an instance of the ISideShowNotification class
// and check for failure.
//
// CLSID_SideShowNotification and IID_ISideShowNotification
// are defined in the file WindowsSideShowApi.h.
//
hr = ::CoCreateInstance(CLSID_SideShowNotification,
                        NULL,
                        CLSCTX_INPROC_SERVER, 
                        IID_ISideShowNotification,
                        (void**)&pISideShowNotification);

if (FAILED(hr))
{
    //
    // Handling of failures will be application-specific.
    //
    HandleFailure("Failed to CoCreate a notification object", hr);
}

See Also

Concepts

ISideShowNotificationManager
Gadget-Implemented Interfaces