Beyond Windows Media Player

May 15, 2009 13:40 GMT  ·  By

In Windows 7, the default media player is synchronized with the operating system's libraries. Windows Media Player hooks into the Windows 7 Music, Video, and Pictures Libraries, for all the information on content it needs. This allows the program to no longer store its own database for the items on the local machine. Furthermore, Windows Media Player in Windows 7 is now synchronized with all the libraries across the operating system. This means that the media player will be aware of any changes in terms of content that end users introduce to the libraries. But Microsoft says it doesn't stop with Windows Media Player. Additional applications in Windows 7 have the possibility to hook and keep in sync with the libraries of the platform, explains Yochay Kiriaty, Windows 7 technical evangelist on the Client Platform Evangelist Group.

“To detect changes in items within a library using the Shell programming model, use the SHChangeNotifyRegister to listen for changes to items in all library folders. SHChangeNotifyRegister can take a single library item, for example the Music library, as a parameter to receive notifications on all content included in the library,” Kiriaty states. “The user may additionally modify the folders that have been included in the library without using the IShellLibrary API. For this reason, you should call SHResolveLibrary each time the library is loaded to identify changes to the folders included in the library.”

Applications making use of the Shell programming model will be able to keep track of all the items in the Music library, and detect any changes. The updating process will happen on the spot in the context in which libraries are registered. And at the same time, programs can be aware of changes to the folders within a library, by using the library management dialog or the IShellLibrary interface.

“If your application needs to manage a library folder, like the Music folder, invoking the library management dialog (SHShowManageLibraryUI) will provide a consistent user experience for managing Windows Explorer libraries. If you choose to use this interface, it will make the changes to the library directly – as if Windows Explorer modified the library contents directly. Note that this dialog will not return any information to your application; if you show library contents within your application, you will need to receive notifications directly from the Shell,” Kiriaty adds.

32-bit and 64-bit Windows 7 (Release Candidate) RC Build 7100.0.090421-1700 is available for download here.