Share via


Windows Media Player 11 SDK IWMPMediaCollection.setDeleted (VB and C#) 

Windows Media Player SDK banner art

Previous Next

IWMPMediaCollection.setDeleted (VB and C#)

The setDeleted method moves the specified media item to the deleted items folder.

  

Parameters

pItem

A WMPLib.IWMPMedia interface for the item to be moved.

varfIsDeleted

A System.Boolean value that specifies whether the item should be moved to the deleted items folder. This value must always be true.

Return Value

This method does not return a value.

Remarks

This method does not remove files from the user's computer, it just moves them to the deleted items folder.

Before calling this method, you must have read access to the library. For more information, see Library Access.

Example Code

The following example uses setDeleted to move a particular media item to the deleted items folder. The isDeleted method first tests whether the item has already been deleted. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

  
' Test whether the media item has already been deleted.
If (Not player.mediaCollection.isDeleted(media)) Then

    ' The item is available to be deleted move it to the deleted items folder.
    player.mediaCollection.setDeleted(media, True)

    ' Inform the user that the operation succeeded.
    System.Windows.Forms.MessageBox.Show("Item moved to deleted items folder.")

Else

    ' Tell the user the operation is unnecessary.
    System.Windows.Forms.MessageBox.Show("Item is already deleted!")

End If

FakePre-16ea20b97718463d9a1af29ce9edecf5-953fd9e5f2104572b20d19f7882fec02

// Test whether the media item has already been deleted.
if (!player.mediaCollection.isDeleted(media))
{
    // The item is available to be deleted; move it to the deleted items folder.
    player.mediaCollection.setDeleted(media, true);

    // Inform the user that the operation succeeded.
    System.Windows.Forms.MessageBox.Show("Item moved to deleted items folder.");
}
else
{
    // Tell the user the operation is unnecessary.
    System.Windows.Forms.MessageBox.Show("Item is already deleted!");
}

Requirements

Version: Windows Media Player 9 Series or later

Namespace: WMPLib

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

See Also

Previous Next