ISideShowNotification::Message Property 

Contains the main textual portion of a notification.

Declaration

[C++]

HRESULT get_Message(
    LPWSTR *out_ppwszMessage
);

HRESULT put_Message(
    LPWSTR in_pwszMessage
);

Property Value

out_ppwszMessage

[out] A pointer into which the address of a string containing the main portion of the notification is written.

in_pwszMessage

[in] A string that contains the main portion of the notification.

This property is read/write.

Return Values

HRESULT value Description

S_OK

Success

E_INVALIDARG

Either of the parameters out_ppwszMessage or in_pwszMessage is NULL.

E_OUTOFMEMORY

CoTaskMemAlloc failed to allocate the memory required to return the message 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 message string is being assigned to this property (put), the string is copied locally and the caller retains ownership of the string memory. When a message 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 the ISideShowNotification::Message 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_Message to write the Message 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_Message(L"This is the notification message.");

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


Applies To

Show: