2

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.

Paul Jenkins
  • 993
  • 1
  • 11
  • 19
  • Note that some of the MSDN documentation says how to do stuff in C# but has "C ++" written above it because they mistakenly label it as the wrong language (thanks MS). – Max von Hippel Aug 05 '15 at 21:27

3 Answers3

2

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
  • 431
  • 4
  • 7
  • 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. – Paul Jenkins Jul 18 '09 at 06:26
  • 1
    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 Jul 19 '09 at 17:36
1

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
  • 733,204
  • 149
  • 1,241
  • 1,454
  • 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.aspx I guess part of the problem is that it requires the C++ WMP Plugin Wizard in both cases. – Paul Jenkins May 11 '09 at 01:32
1

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.

brutuscat
  • 3,139
  • 2
  • 28
  • 33
Magnus Johansson
  • 28,010
  • 19
  • 106
  • 164