Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Example of how to use WinExec function

225 views
Skip to first unread message

Vincent Taijeron

unread,
Jun 21, 1997, 3:00:00 AM6/21/97
to

Could someone please give me an example of how to use the winexec
function to launch another program?

Basically I want to be able to launch the other program using a button
or menut item.

Thanks.

Geir Bratlie

unread,
Jun 22, 1997, 3:00:00 AM6/22/97
to

Hi!

Try this:

Procedure StartProgram(Pr:string);
var
Prog:array[0..255] of Char;
begin
StrPCopy(Prog,Pr);
WinExec(Prog,1);
end;


-Geir-
ro...@sn.no

Gunnar Martensen

unread,
Jun 23, 1997, 3:00:00 AM6/23/97
to
procedure TMainForm.ItemRunClick(Sender: TObject);
var array[0..255] of Char;
begin
Copy Exefilename to Buffer ...
if WinExec(Buffer,sw_ShowNormal) < 32 then
something is rotten


enzo

unread,
Jun 23, 1997, 3:00:00 AM6/23/97
to

Hi Vincent
belowe an example to call a program myProg2.exe ( or if you prefer
write.exe or other )

aaa. array[0..120] of char;
wsts: word;
..............

if fileExists( myFile ) then
begin
str1 := 'myProg2.exe ' + myFile;
wsts := Winexec( strpCopy(aaa,str1), SW_SHOW );
if ( wsts < 32 ) then
MessageDlg('WinExec error '+ intToStr(wsts), mtInformation,
[mbRetry], 0 );
end;

Regards, Enzo
Enzo Arlati e.ar...@sinergy.it
Sinergy srl via Modigliani 45, Segrate
20090 (MI)
tel: +39 2 26921619 fax: +39 2 26922048
http://arlati.sinergy.it http://www.sinergy.it


Vincent Taijeron <red...@worldnet.att.net> wrote in article
<33abef26...@netnews.worldnet.att.net>...

0 new messages