How to interact with Windows Media Player in C#

Just add a reference to wmp.dll (\windows\system32\wmp.dll)

using WMPLib;

And then you can instantiate a media player

var Player = new WindowsMediaPlayer();
// Load a playlist or file and then get the title 
var title = Player.controls.currentItem.name;

See Creating the Windows Media Player Control Programmatically for more information

Leave a Comment