Board index » delphi » Launch and external program from within Delphi

Launch and external program from within Delphi

Hi

I want to launch Adobe Acrobat reader from within Delphi to view a file. How
do I do that.

I know that you have to "spawn" a new process. The WinAPI has a function
"ExecProgram", but I cannot seem to exeute it.

Regards

Willie

 

Re:Launch and external program from within Delphi


Hello Willie

Willie Marais schrieb:

Quote
> I want to launch Adobe Acrobat reader from within Delphi to view a file. How
> do I do that.

try this
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uses ShellAPI;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if
ShellExecute(Handle,PChar('open'),PChar('c:\myfiles\mypdf.pdf'),nil,nil,SW_SHOW)
<= 32 then
//    Report Error
  else
//    Report Process Started;
end;
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
This opens the Application which is registered to opens a *.pdf, normally
Acrobat Reader.

Quote
> Regards
> Willie

Regards Ekkehard

--
DomIS Internet Solution - Ekkehard Domning
Im "mCC": Industriestr. 17 - 49740 Haselnne
Mail: e...@domis.de Internet: http://www.domis.de

Other Threads