Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Get "current playing" movie/song in WMP

Get "current playing" movie/song in WMP

Scheduled Pinned Locked Moved C#
helptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mulybenj
    wrote on last edited by
    #1

    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.

    H 1 Reply Last reply
    0
    • M mulybenj

      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.

      H Offline
      H Offline
      henur
      wrote on last edited by
      #2

      The playing item could be found in: WMP.currentMedia.name Heino

      M 1 Reply Last reply
      0
      • H henur

        The playing item could be found in: WMP.currentMedia.name Heino

        M Offline
        M Offline
        mulybenj
        wrote on last edited by
        #3

        Thank u for your reply!! how can i appoint this Object? please give me an example?

        H 1 Reply Last reply
        0
        • M mulybenj

          Thank u for your reply!! how can i appoint this Object? please give me an example?

          H Offline
          H Offline
          henur
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups