Get "current playing" movie/song in WMP
-
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.
-
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.
The playing item could be found in: WMP.currentMedia.name Heino
-
The playing item could be found in: WMP.currentMedia.name Heino
-
You must have AxWMPLib in your reference of your C#-project. Then you have to add the Mediaplayer as a control to your form. For instance, name the control to "WMP". After that you can do. WMP.URL = "the musicfile full path"; string cName = WMP.currentMedia.name; Heino