次の方法で共有


Library Classification Registry Entries

[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.]

When Windows Media Player encounters a media file that has a custom file name extension, it does not know whether the file should be classified as audio, video, or some other type. By default, Windows Media Player places such files in the Other Media portion of the library.

If your digital media files have a custom format, you can provide Windows Media Player with information about where your files should appear in the Player's library by placing two entries in the registry on the user's computer.

One entry goes in the following subkey.

HKEY_LOCAL_MACHINE\Software\Microsoft\MediaPlayer\MLS\Extensions

The registry entry has the following format.

Name Data type Value
The file name extension without the dot (.) separator REG_SZ A string that specifies a library location

 

The other registry entry goes in the following subkey that you create.

HKEY_CLASSES_ROOT\ customExtension

where customExtension is the file name extension including the dot (.) separator.

The registry entry has the following format.

Name Data type Value
PerceivedType REG_SZ A string that specifies a library location

 

Both registry entries must have the same value. Possible values are given in the following table.

Value Description
audio Files that have the custom extension appear in the music portion of the library.
video Files that have the custom extension appear in the video portion of the library.

 

For example, the following registry entries specify that files having the file name extension .xyz will appear in the music portion of the library:


HKEY_LOCAL_MACHINE\Software\Microsoft\MediaPlayer\MLS\Extensions
    xyz     REG_SZ     audio

HKEY_CLASSES_ROOT\.xyz
    PerceivedType     REG_SZ     audio

Note that any code that attempts to write to the registry on the user's computer can write to the HKEY_LOCAL_MACHINE subtree only if the current user has administrative privileges.

Library classification registry entries are supported by the following versions of Windows Media Player.

  • Windows Media Player 9 Series with hotfix 823275
  • Windows Media Player 10 and later

File Name Extension Registry Settings