Share via


IWMDMNotification::WMDMMessage

banner art

The WMDMMessage method is a callback method implemented by the clients. Windows Media Device Manager calls this method on device or media arrival or removal.

Syntax

HRESULT WMDMMessage(
  DWORD  dwMessageType,
  LPCWSTR  pwszCanonicalName
);

Parameters

dwMessageType

[in]  A DWORD containing the message type.

The possible values for the event types are the following:

Message type Description
WMDM_MSG_DEVICE_ARRIVAL WMDM device has been plugged in
WMDM_MSG_DEVICE_REMOVAL WMDM device has been removed
WMDM_MSG_MEDIA_ARRIVAL Media has been inserted in WMDM device
WMDM_MSG_MEDIA_REMOVAL Media is removed from WMDM device

pwszCanonicalName

[in]  Pointer to a null-terminated string containing the canonical name of the device for which this event is generated.

Return Values

The return value is an HRESULT in which application can return results of its processing of the message. The return value is ignored by WMDM.

Remarks

Application that is interested in subscribing to Windows Media Device Manager notifications should call QueryInterface to obtain IConnectionPointContainer interface pointer of the IWMDeviceManager object. It should then call FindConnectionPoint on this interface passing the IID of IWMDMNotification interface to obtain IConnectionPoint interface corresponding to IWMDMNotification. It should then call Advise on the connection point to subscribe to Windows Media Device Manager notifications.

When the application wants to unsubscribe from the Windows Media Device Manager notifications, it should call Unadvise method on the connection point.

For more information on connection points please refer to COM documentation.

Requirements

Header: Defined in wmdm.idl.

Library: mssachlp.lib

See Also