Reputation: 5319
Using C# how can I get the name of the song, artists etc that is currently playing in Windows Media Player? Applications like MSN Messenger / Google Talk do this. Thanks
Upvotes: 4
Views: 5490
Reputation: 46
For C#
I spent hours trying to get it to work for my program. Finally I figured it out.
This solution is assuming you have either the windows media player control ON a form in your project or have created the object through code..
create a string to hold your title, then pull the artist info from the song object.
WMPLib.IWMPMedia song = wmp.newMedia(@"C:\SongName.mp3");
string tmpArtist = song.getItemInfo("Artist");
string tmpTitle = song.getItemInfo("Title");
it was so simple i slapped myself when i finished, and seeing as i couldnt find the answer anywhere, i have provided it for the next guy.
Upvotes: 3
Reputation: 3825
You need to use Wmp.dll.
This link will also be helpful:
http://msdn.microsoft.com/en-us/library/dd563844(VS.85).aspx
Upvotes: 2