tags:

views:

1820

answers:

3

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.

A: 

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?

JaredPar
I found two that may be a good starting point for somebody more knowledgeable than me, http://www.microsoft.com/belux/msdn/nl/community/columns/munoz/extendwmp_part1.mspx and http://blogs.msdn.com/coding4fun/archive/2007/12/20/6821379.aspxI guess part of the problem is that it requires the C++ WMP Plugin Wizard in both cases.
aeoth
A: 

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

Magnus Johansson
+1  A: 

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/

theahuramazda
That looks to be the closest I've seen, thank you. I'll have to try and track down the author to see if he ever did implement more than the initial check in.
aeoth
I'm the author and I've not done much with the project since then. I was suppose to show how to get the project up and running, and how to install the plugins, etc.I'll be happy to answer any questions you may have.
theahuramazda