Accessing Windows Media Player Properties Through COM

S

Stephen Adam

Hi there,

Have spent a while trying to find out how to connect to Windows Media Player
through COM. Unfortunately there doesnt seem to be much stuff about it on
the web.

What I need to do is create a simple console application which will be able
to find out what the values of a currently playing tack.

I've downloaded the Windows Media player SDK which come with some IDL and
header files which I assume I need to communicate with the Windows Media
Player COM componants.

What i've done so far is created a reference to the windows media player COM
interface by going to Add reference / com in the solutions explorer. Next
i've created the Media Player name space by adding "using MediaPlayer;" to
the application.

What I want to know is how to add the IDL files to my project so I can
access the Windows Media Player COM interface. If you could help by giving
me a bit of example code (i.e, how to get how long the currently playing
track is) and explaining how and if IDL comes into it and how to implement
it.

PS - i've found code to create an instance of Windows Media Player but how
to I just create a reference to the currently active instance of it.

Thanks

Steve
 
S

Scott Allen

Hi Stephen:

To get to a remoted media player (remoted as in another process)
requires some wierd interfaces like IWMPRemoteMediaServices.
Fortunately, somone pretty smart with C# (Eric Gunnerson from MS) was
trying to do this a month or so ago and ended up providing a wrapper:

Remotable WMP Player Wrapper for C#
http://www.gotdotnet.com/Community/...mpleGuid=1f2ad011-abf1-4dfd-85c6-49006903e483

This gives you access to the full player instead of just the hostable
ActiveX control.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top