Muly Benj

Hello there! I've been trying, without any luck for the past week or so to get the "currently playing" movie/song in my Windows Media Player.

I know I need to use SendMessage to send and receive info from WMP. I've managed to write Play/Pause/Stop methods:

Example:

---

// stop WMP movie/song

IntPtr ptrWindow = FindWindow("WMPlayerApp", "
Windows Media Player");

if (ptrWindow == IntPtr.Zero)
return;

SendMessage(ptrWindow, WM_COMMAND, 0x00004979, 0x00000000);

---

However, this doesn't get me anywhere near the "Currently Playing" movie/song. I've looked into the WMP
SDK, but that doesn't seem to help. I don't want to make a new instance of WMP. I want to read the currently playing info from my own WMP app that's open.

I'd appreciate any help in getting closer to what I need.

Thanks in advance.


Re: Media Foundation Development Get "current playing" movie/song in WMP

Jesus Jimenez

Hi Muly,

I know what you want to do, I tried that some time ago and it's not posible to get the info about the current playing media out of the WMP player instance.

Depending on the amount of information about the current playing media I think you have two choices to achieve your goal.

1o - You can install the WMP Blogging Plug-In. That's a plugin for WMP that writes the current media info to the windows registry, then you can get the media info from the registry.

2o You can write you own WMP Plugin, this is the hardest way, but you will have all the information from WMP. I haven't write a WMP plugin yet, but I'm planning to do that.

You can chek the Windows Media SDK on MSDN to see how to create a WMP Background Plugin.

Hope this help.