How to interact with Windows Media Player in C#

后端 未结 4 1268
悲哀的现实
悲哀的现实 2020-11-29 23:45

I am looking for a way to interact with a standalone full version of Windows Media Player.
Mostly I need to know the Path of the currently played track.

The iTun

4条回答
  •  渐次进展
    2020-11-30 00:03

    The best info I have seen on interacting with Windows Media Player is this article written by Stephen Toub.

    He lists a whole load of different ways to play dvr-ms files (doesn't really matter what format they are for this though). The bit that is possibly of interest to you is about using a Media Player ActiveX Control, which you can add to the visual Studio toolbox by right-clicking and adding the Windows Media Player ActiveX COM Control. You can then embed the player into your app, and access various properties of Media Player, like the url:

    WMPplayer.URL = stringPathToFile;
    

    This solution is possibly not what you want because it's starting a new instance of Media Player (as far as I know), however it might point you in the right direction.

提交回复
热议问题