Page 1 of 1

Retrieving the current filename from another application

Posted: 24 Mar 2008 20:08
by briantokyo
How could I accurately retrieve the current media being played in VLC? The DLL seems to provide this info only for an app using it to play on its own, but not for an external application trying to find the current media being played in the VLC player itself.

So far I've come up with 3 ways to do this, but none is perfect.

1 - Retrieving the tray icon (must be enabled) hint. This is really bad because there is a limit in the number of characters, and usually it will be too short. (the hint contains the path+filename)
2 - Retrieving all the file/device handles in use by the VLC process and parse through the items to check for common video extensions. Sometimes it will open handles to all the files in a single directory so you can't accurately tell which one is being used.
3 - Retrieve the text in the statusbar panel on the bottom of the GUI

#2 and #3 have an extra problem, if the player is in full screen or using another gui/interface, they will fail.

Wish there was an option to add the filename in the window captionbar, like most other players do, then it would be very easy.

Any ideas?

Re: Retrieving the current filename from another application

Posted: 29 Mar 2008 06:16
by briantokyo
Can also retrieve the commandline but that only works for the first file.