Share via


ISideShowNotification::Title Property 

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

Declaration

[C++]

HRESULT get_Title(
    LPWSTR *out_ppwszTitle
);

HRESULT put_Title(
    LPWSTR in_pwszTitle
);

Property Value

out_ppwszTitle

[out] A pointer into which the address of a string containing the title of the notification, if any, is written. If there is no notification title, the pointer is set to NULL.

in_pwszTitle

[in] A string that contains the title of the notification, or NULL if there is no title.

This property is read/write.

Return Values

HRESULT value

Description

S_OK

Success

E_INVALIDARG

Either of the parameters out_ppwszTitle or in_pwszTitle is NULL.

E_OUTOFMEMORY

CoTaskMemAlloc failed to allocate the memory required to return the title to the caller.

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.

When a title string is being assigned to this property (put), the string is copied locally and the caller retains ownership of the string memory. When a title string is being retrieved from this property (get), the memory for the returned string is allocated by using CoTaskMemAlloc and the caller is responsible for deallocating the memory by using CoTaskMemFree.

The default value of this property is an empty string.

Example

This example demonstrates how to set the value of theISideShowNotification::Title 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_Title to write the Title property, passing
// a static wide string.
//
// Use a previously established pointer to the
// ISideShowNotification interface of an
// SideShowNotification object.
//
// Also check for failure.
//
hr = pISideShowNotification->put_Title(L"This is the Notification Title");

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

Applies To

ISideShowNotification

See Also

Concepts

ISideShowNotificationManager