How to Detect the Currently Opened Files in VB6 for Media Centre

216 Views Asked by At

I am writing a Media Centre Addin in Vb6 and it was all going good until i got to the point where i want to find the "Currently Playing song FilePath or URl"

I have spend a number of hours racking my brain to figure out a way of seeing what the "Currently Opened Files" are on a machine at any point of time.

My idea is to get all the currently opened files, and then filter the Extensions from these and find the media item that is currently playing, and get the filepath..

Does anyone know how i can do this? and what methods or classes or Librarys i should be looking at or importing In.. This one has really got me thinking.

I was looking at the WMI Windows Management controls, but cant seem to find what i am looking for.. any help would be great..

1

There are 1 best solutions below

0
On

I'm not sure you can do this in VB6.

The Media Center SDK indicates that the Microsoft.MediaCenter namespace will expose the MediaCollection class. This class has an AddItem method that can be used to build the collection as songs(files) are opened. There is a Property named IsActive that indicates if that particular collection is Active(being played)

You would be able to enumerate the files(songs) that make up the collection to see what is being played. And then remove them as they are released.

Not sure if this helps or not.

Thanks, --Doc