Windows Media Player 中当前播放的项目(wmplayer.exe 版本 12)
已经尝试这个有一段时间了。 我在网上看到的所有解决方案似乎都不起作用,特别是非常简单的方法。
<代码> WMPLib.WindowsMediaPlayer c = new WMPLib.WindowsMediaPlayer();
IWMPMedia i = (IWMPMedia)c.currentMedia;
c.currentMedia 始终为空。
看来 new WMPLib.WindowsMediaPlayer();始终创建 Windows Media Player 的新实例。 首先,我认为这是我以管理员身份运行 Visual Studio 的事实,但更改这一点并没有帮助。
似乎我必须以某种方式连接到 wmplayer.exe 的运行实例,但无法找到方法来做到这一点。
顺便提一句。我需要的是当前播放歌曲的完整文件 url(如果是流媒体,则为 fullurl,但这是我现在最不关心的问题。)
Been trying this for a while now.
All solutions I've seen on the net don't seem to work, specially the really simple way to do it.
WMPLib.WindowsMediaPlayer c = new WMPLib.WindowsMediaPlayer();
IWMPMedia i = (IWMPMedia)c.currentMedia;
c.currentMedia is always null.
It seems that new WMPLib.WindowsMediaPlayer(); is always creating a new instance of the Windows Media Player.
First I thought it was the fact that I was running visual studio as Administrator, but changing that did not help.
Seems I somehow have to connect to the running instance of wmplayer.exe but have unable to find a way to do that.
Btw. What I need is a full file url for the current playing song (or fullurl if streaming, but that's the least of my concerns now.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题已在此处得到解答。
来自 SamAgain
Your question answered here.
from SamAgain