Windows Media Player 11 SDK IWMPSettings2::requestMediaAccessRights 

Windows Media Player SDK banner art

Previous Next


The requestMediaAccessRights method requests a specified level of access to the library.


    HRESULT requestMediaAccessRights(
  BSTR  bstrDesiredAccess,
  VARIANT_BOOL*  pvbAccepted



[in]  BSTR containing the one of the following values.

Value Description
none Current item access rights only.
read Read access rights only.
full Read/Write access rights.


[out]  Pointer to a VARIANT_BOOL indicating whether the requested access rights were granted.

Return Values

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.


A Web page must first request permission from the user to read information from or write data to the library. Invoking this method prompts the user with a dialog box that requests the specified permission level. This means that certain methods, properties, and events will be inaccessible from code if the appropriate access rights have not been granted. The current access rights level can be retrieved by using IWMPSettings2::get_mediaAccessRights.

Applications running on the user's computer are not required to use this method.

Windows Media Player 10 Mobile: This method always retrieves a VARIANT_BOOL set to TRUE.


Version: Windows Media Player 9 Series or later.

Header: Include wmp.h.

Library: Use wmp.dll.

See Also

Previous Next