Share via


Windows Media Player 11 SDK IWMPCdrom.eject (VB and C#) 

Windows Media Player SDK banner art

Previous Next

IWMPCdrom.eject (VB and C#)

The eject method ejects the CD or DVD from the drive.

  

Parameters

This method takes no parameters.

Return Value

This method does not return a value.

Remarks

If the drive door is open, this method closes the door.

To use this method, read access to the library is required. For more information, see Library Access.

Example Code

The following example uses eject to open the door of the CD or DVD drive that has the index of zero in response to the Click event of a button. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

  
Public Sub ejectButton_Click(ByVal o As Object, ByVal args As System.EventArgs) Handles ejectButton.Click

    player.cdromCollection.Item(0).eject()

End Sub

FakePre-0700446c83ee4ddb9e15ddc77aea7f29-09495b0fc15f4c8d9ab17063325e8cdc

private void ejectButton_Click(object o, System.EventArgs args)
{
    player.cdromCollection.Item(0).eject();
}

Requirements

Version: Windows Media Player 9 Series or later

Namespace: WMPLib

Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)

See Also

Previous Next