Partager via


ISideShowEvents::DeviceAdded Method 

Notifies the Windows SideShow gadget that it is now associated with an additional device.

Declaration

[C++]

HRESULT DeviceAdded(
    ISideShowCapabilities *in_pIDevice
);

Parameters

in_pIDevice

[in] A pointer to an ISideShowCapabilities interface that describes the additional device that is now associated with the Windows SideShow gadget.

Return Values

HRESULT value

Description

S_OK

Success, indicating that the Windows SideShow gadget acknowledges the addition of the new device.

Other HRESULT values

The Windows SideShow gadget may return HRESULT values other than S_OK to communicate error conditions to the Windows SideShow platform.

Remarks

A Windows SideShow gadget implements the ISideShowEvents interface, through which the Windows SideShow platform posts events to the gadget. The gadget uses the SetEventSink method of the ISideShowContentManager interface to provide a pointer to the ISideShowEvents interface through which events should be posted.

This event is generated in two ways: First, when a previously configured device is physically connected; and second, when an already connected device becomes associated with the Windows SideShow gadget as a result of user configuration within the Windows SideShow Control Panel.

Example

This example demonstrates one possible implementation of the ISideShowEvents::DeviceAdded Method in the client-implemented ISideShowEvents interface. Other implementations are, of course, possible.

A common action that a Windows SideShow gadget might take when a new device is added is to resend all of its content, as illustrated by the following example.

[C++]

STDMETHODIMP CSideShowEvents::DeviceAdded(ISideShowCapabilities* pCapabilities)
{
    //
    // Call a routine to resend all content to the new device.
    //
    ResendContent(pCapabilities);

    return S_OK;
}

Applies To

ISideShowEvents

See Also

Concepts

ISideShowContentManager
ISideShowContentManager::SetEventSink Method
ISideShowEvents::DeviceRemoved Method