Windows Media Player (11+) C# 插件

发布于 2024-07-21 03:52:35 字数 253 浏览 6 评论 0原文

是否可以用 C# 创建 WMP11+(当然,版本越多越好,但我现在只针对 Vista 及以上版本)插件? 我找到的所有资源都显示了 C++ 的情况,但没有显示 C# 的情况。

我正在尝试创建一个与 WMP 交互的插件,类似于 Last.FM/“正在播放”插件(即“后台”类插件),因为它位于后台并执行某些操作,而不是想要访问 WMP 数据的通用应用程序。 Windows SDK 中的 WMP 托管示例仅显示从单独的应用程序与 WMP 库/“控件”交互的示例。

Is it possible to create WMP11+ (well, sure, the more versions the better, but I'm only targeting Vista onwards for now) plugin in C#? All the resources I've found show it for C++, but not for C#.

I'm trying to create a plugin that interacts with WMP along the lines of Last.FM/the 'Now Playing' plugin (that is a "Background" class plugin), in that it sits in the background and does stuff, not a general app that wants to access WMP's data.
The WMP Managed sample in the Windows SDK only shows the example of interacting with the WMP library/"control" from a separate application.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

去了角落 2024-07-28 03:52:35

可能不完全是您正在寻找的内容,但您可以查看该项目的代码:
http://wmppluginsnet.codeplex.com/

May not be exactly what you're looking for but you can have a look at the code from this project:
http://wmppluginsnet.codeplex.com/

绾颜 2024-07-28 03:52:35

我对 WMP 的插件架构不是很熟悉,但是只要该机制是基于 COM 的,那么就可以编写 C# 插件。 COM 是一种用于公开 API 的语言中立方法。 在 C# 和大多数其他 .Net 语言中,可以创建 COM 组件并因此插入 COM 体系结构中。

这会带来一些问题。 在 2.0SP1 之前,只能在一个进程中创建单一版本的 CLR。 插件架构的效果是第一个 .Net 插件将为进程设置 CLR 版本。 例如,如果您的插件是基于 1.0 的并且首先加载没有问题。 但任何想要在 2.0 CLR 中运行的后续插件都不太走运。

您可以发布一些您正在谈论的示例的链接吗?

I'm not terribly familiar with WMP's plugin architecture, but as long as the mechanism is COM based then yes, you can write C# plugins. COM is a language neutral method for exposing APIs. In C#, and most other .Net languages, it's possible to create COM components and hence plug into a COM architecture.

There are a few problems that come with this. Up until 2.0SP1 it was only possible to create a single version of the CLR in one process. The effect of a plugin architecture is that the first .Net plugin will set the CLR version for the process. So for example if your plugin is 1.0 based and it loads first no problem. But any subsequent plugins that want to run in the 2.0 CLR are out of luck.

Can you post some links to the samples that you are talking about?

筱武穆 2024-07-28 03:52:35

您链接到的同一作者 Ianier Munoz 也发表了 C# 文章 (损坏的旧链接)有关编写 Windows Media Player 插件的信息。 你也许可以使用其中的一些东西。

The same author that you have linked to, Ianier Munoz, did also publish a C# article (broken old link) on writing Windows Media Player plugins. You can probably use something from that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文