IWMPEvents2 interface (wmp.h)

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The IWMPEvents2 interface provides events originating from the Windows Media Player 10 or later control to which an embedding program can respond. The events exposed by IWMPEvents2 are also exposed by the _WMPOCXEvents interface.

The events provided by IWMPEvents2 are related to device synchronization. To receive these events you must create a remoted instance of the Windows Media Player 10 or later control.

In addition to the methods inherited from IWMPEvents, the IWMPEvents2 interface exposes the following methods.

Method Description
CreatePartnershipComplete Occurs when an asynchronous call to IWMPSyncDevice::createPartnership completes.
DeviceConnect Occurs when the user connects a device to the computer.
DeviceDisconnect Occurs when the user disconnects a device from the computer.
DeviceStatusChange Occurs when the partnership status of a device changes.
DeviceSyncError Occurs when a synchronization error happens.
DeviceSyncStateChange Occurs when the synchronization state of a device changes.

Inheritance

The IWMPEvents2 interface inherits from the IWMPEvents interface.

Methods

The IWMPEvents2 interface has these methods.

 
IWMPEvents2::CreatePartnershipComplete

The CreatePartnershipComplete event occurs when an asynchronous call to IWMPSyncDevice::createPartnership completes.
IWMPEvents2::DeviceConnect

The DeviceConnect event occurs when the user connects a device to the computer.
IWMPEvents2::DeviceDisconnect

The DeviceDisconnect event occurs when the user disconnects a device from the computer.
IWMPEvents2::DeviceStatusChange

The DeviceStatusChange event occurs when the partnership status of a device changes.
IWMPEvents2::DeviceSyncError

The DeviceSyncError event occurs in response to a synchronization error.
IWMPEvents2::DeviceSyncStateChange

The DeviceSyncStateChange event occurs when the synchronization state of a device changes.

Requirements

Requirement Value
Target Platform Windows
Header wmp.h

See also

Handling Events in C++

IWMPEvents Interface

IWMPSyncDevice::createPartnership

Interfaces

Remoting the Windows Media Player Control

_WMPOCXEvents Interface