Share via


Windows Media Player 11 SDK Folder Monitoring Registry SettingsĀ 

Windows Media Player SDK banner art

Previous Next

Folder Monitoring Registry Settings

Windows Media Player 9 Series or later can monitor file folders to check whether new digital media files have been added. When the Player detects a new file in a monitored folder, it automatically adds the file to the library. Users can change the list of monitored folders by clicking Monitor Folders on the library tab of the Options dialog box. You can programmatically add a folder to be monitored by adding a value to the registry.

To add a folder for monitoring you must first create or modify two values in the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences\

The new values must be named as follows.

Name Type Description
TrackFoldersDirectories REG_DWORD A DWORD value that represents the count of folders to monitor. This must match the count of TrackFoldersDirectoriesX values.
TrackFoldersDirectoriesX REG_SZ A string value that represents the path of the folder to monitor. Each folder to monitor requires a separate value. The suffix X is an integer that should always begin at 0 and then increment by 1. Windows Media Player also monitors subfolders of the specified folder.

For example, to add the first folder to monitor, add the following value:

[HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences]
"TrackFoldersDirectories0" = "c:\MyPath\MyFolder"

Then, create the count value:

[HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences]
"TrackFoldersDirectories" = dword:00000001

To add a second folder to monitor, add the following value:

[HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences]
"TrackFoldersDirectories1" = "c:\MyPath\MyFolder2"

Then, increment the count value:

[HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences]
"TrackFoldersDirectories" = dword:00000002

See Also

Previous Next