Board index » delphi » Problems Launching AVI and MPG files

Problems Launching AVI and MPG files

I'm having difficulty when trying to launch certain file types:-

I would like to give the user the ability to launch different file types in
much the same way as you would expect when double clicking on a file in
Windows Explorer.

The way I have programmed it so far is by first determining the application
(using the FindExecutable command) and then launching the application with
the appropriate file parameter (using the WinExec command).

Most of the different file types (e.g. DOC, XLS, PPT, BMP) work fine, but
I'm having difficulty with the AVI and the MPG movie files:

  The FindExecutable command returns:
            C:\WINDOWS\Rundll32.exe#0c:\windows\system\Amovie.ocx,RunDll
/open '@'#0

  and when I try to launch an AVI or MPG file using the WinExec with a
different parameters I get the
  following errors:

      Launch = "c:\my documents\themovie.avi"
      Error  = The value 0 was returned from WinExec which, according the
help, means
               "The system is out of memory or resources."

      Launch = c:\WINDOWS\Rundll32.exe "c:\my documents\themovie.avi"
      Error  = Nothing happens.

      Launch = C:\WINDOWS\Rundll32.exe c:\windows\system\Amovie.ocx,RunDll
/open "c:\my documents\themovie.avi"
      Error  = Active Movie could not render the file.

What do I need to do in order to launch an AVI or MPG file?  Will this
technique also work for the other file types?

Thanks in advance.

Paul.

 

Re:Problems Launching AVI and MPG files


Paul Linsell schrieb in Nachricht <79mvc8$q9...@newnews.global.net.uk>...
Quote
>I'm having difficulty when trying to launch certain file types:-

The most easiest way is to use the function ShellExecute.

In your example the syntax might be:

     ShellExecute(Handle,'open','C:\My
documents\themovie.avi',nil,nil,sw_shownormal);

For the rest have a look at the Win32 help files.

Hth,
Matthias.

Re:Problems Launching AVI and MPG files


I may be WAY off target here, but can't you just use the ActiveMovie ActiveX
component.  That's what I do and it works great.

--

Tags
--------
http://members.xoom.com/thepjs/
Remove DIESPAM to reply
--
"Never trust a man who uses smileys :) "

Quote
Matthias Thiel wrote in message <79n0e1$...@desire.lavielle.com>...
>     ShellExecute(Handle,'open','C:\My
>documents\themovie.avi',nil,nil,sw_shownormal);

Other Threads