photonbuddy Posted January 26, 2007 Share Posted January 26, 2007 Hi All, I have written a program I use on DVD's with movie files on it, that scans the DVD and then brings up a GUI with a button to launch each media file found. It works fine on my system, where I have media player classic installed and set as default media player. Tonight, however, I took one of my DVD's to a friends place who is running XP media centre (I run Win2k), and the program would not launch properly. When clicking a button, media player would load, but would not load in the media and play it. Currently I test for a few media types and play them thus: Select Case StringRight($filename, 3) = "AVI" $sType = RegRead('HKEY_Classes_Root\.avi', '') If $sType <> '' Then $sCommand = RegRead('HKCR\' & $sType & '\Shell\Open\Command', '') If $sCommand <> '' Then $sCommand= (StringReplace($sCommand, '"%1"','"'&$filename&'"')) $mplayer = $sCommand Case StringRight($filename, 3) = "MPG" $sType = RegRead('HKEY_Classes_Root\.mpg', '') If $sType <> '' Then $sCommand = RegRead('HKCR\' & $sType & '\Shell\Open\Command', '') If $sCommand <> '' Then $sCommand= (StringReplace($sCommand, '"%1"','"'&$filename&'"')) $mplayer = $sCommand Case StringRight($filename, 3) = "WMV" $sType = RegRead('HKEY_Classes_Root\.wmv', '') If $sType <> '' Then $sCommand = RegRead('HKCR\' & $sType & '\Shell\Open\Command', '') If $sCommand <> '' Then $sCommand= (StringReplace($sCommand, '"%1"','"'&$filename&'"')) $mplayer = $sCommand Case StringRight($filename, 3) = "MOV" $sType = RegRead('HKEY_Classes_Root\.mov', '') If $sType <> '' Then $sCommand = RegRead('HKCR\' & $sType & '\Shell\Open\Command', '') If $sCommand <> '' Then $sCommand= (StringReplace($sCommand, '"%1"','"'&$filename&'"')) $mplayer = $sCommand EndSelect $mp = $mplayer & " " If GUICtrlRead($fs) = $GUI_CHECKED Then $mp = $mp & "/fullscreen " EndIf RunWait($mp) (I got the basis for this code from another post here, but I can't find that post now) What I'd really like, is a way to simply pass the filename to a function, and get back the appropriate command line from the function to run that media type. Any ideas? Link to comment Share on other sites More sharing options...
thibeaz Posted January 26, 2007 Share Posted January 26, 2007 I was looking for something like this for a long time. I'll certainly will give it a try and then adapt my own version very soon Link to comment Share on other sites More sharing options...
/dev/null Posted January 26, 2007 Share Posted January 26, 2007 (edited) (I got the basis for this code from another post here, but I can't find that post now) What I'd really like, is a way to simply pass the filename to a function, and get back the appropriate command line from the function to run that media type. Any ideas? DOS/Windows command "start" will take care to start the correct application, if the media type is "known/registered" in windows (commands: assoc and ftype) #include <Process.au3> $myfile= "C:\temp\movie1.mpeg" $rc = _RunDos("start " & '""' & $myfile) ; we need the '""', don't remove it !! Edited January 26, 2007 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Developers Jos Posted January 26, 2007 Developers Share Posted January 26, 2007 ShellExcecute() SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
/dev/null Posted January 26, 2007 Share Posted January 26, 2007 ShellExcecute() damn, I allways forget about that ... :"> __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
photonbuddy Posted January 27, 2007 Author Share Posted January 27, 2007 Thanks for the ShellExecute() option. ShellExecute() seems to work, but it doesn't appear to pass the paramters correctly. Specifically: $param="" If GUICtrlRead($fs) = $GUI_CHECKED Then $param = "/fullscreen" EndIf ShellExecuteWait($filename,$mp) Doesn't launch the program in fullscreen mode. Mind you, I think this may be a problem with Windows, as if I use the run box and type in "<media file> /fullscreen" it doesn't work either. If I put the actual media player command in front of the media file name, it runs fine in full screen. Any suggestions for a fix for this? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now