Board index » delphi » Launching an external software

Launching an external software

Hi all,
I want to launch an external software (install .exe) when clicking on a
buton. How to do that?
Thanks for your help.
Jojo
 

Re:Launching an external software


Quote
Jojo wrote in message <9v75fl$mh...@demo2.univ-lyon1.fr>...
>Hi all,
>I want to launch an external software (install .exe) when clicking on a
>buton. How to do that?
>Thanks for your help.

That's in the FAQ. It was posted either this or last week.
You can look for it in DejaNews.

Groetjes,
Maarten Wiltink

Re:Launching an external software


Format :

ShellExecute(Handle,'open',[exe_name],[parameter],[default_dir],[show_mode])
;

In unit :  ShellApi

See windows SDK help for the complete description about the command.

Here is an example:

uses ShellApi;
...
procedure TForm1.Button1Click(Sender: TObject);
begin
  {Ex.: executing Window's notepad}
  ShellExecute(Handle, 'open', 'c:\Windows\notepad.exe', nil, nil,
SW_SHOWNORMAL);

  {Ex.: executing Window's notepad and open a document}
  ShellExecute(Handle, 'open', 'c:\Windows\notepad.exe', 'c:\test.txt', nil,
SW_SHOWNORMAL);

  {Ex.: opening a document according to its extension}
  ShellExecute(Handle, 'open', 'c:\test.txt', nil, nil, SW_SHOWNORMAL);

  {Ex.: opening a folder}
  ShellExecute(Handle, 'open', 'c:\Windows', nil, nil, SW_SHOWNORMAL);

  {Ex.: opening a web site}
  ShellExecute(Handle, 'open', 'http:\\www.yahoo.com', nil, nil,
SW_SHOWNORMAL);

  {Ex.: sending e-mail with default mail client}
  ShellExecute(Handle, 'open', 'mailto:gusto...@yahoo.com', nil, nil,
SW_SHOWNORMAL);
end;

Quote
Jojo <sani...@yahoo.fr> wrote in message

news:9v75fl$mhh$1@demo2.univ-lyon1.fr...
Quote
> Hi all,
> I want to launch an external software (install .exe) when clicking on a
> buton. How to do that?
> Thanks for your help.
> Jojo

Re:Launching an external software


try winexec("mycommad.exe",sw_normal);
you can do winexec("start www.google.de",sw_normal); to call homepages ,)
"Jojo" <sani...@yahoo.fr> schrieb im Newsbeitrag
news:9v75fl$mhh$1@demo2.univ-lyon1.fr...
Quote
> Hi all,
> I want to launch an external software (install .exe) when clicking on a
> buton. How to do that?
> Thanks for your help.
> Jojo

Other Threads