Article View: borland.public.cppbuilder.nativeapi
Article #16695Re: how to start an application from inside my code?
From: StarCinema - Rodolfo Frino
Date: Wed, 30 Apr 2003 00:17
Date: Wed, 30 Apr 2003 00:17
41 lines
2037 bytes
2037 bytes
void __fastcall TForm1::Button1Click(TObject *Sender)
{
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcInfo;
ZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
ZeroMemory(&ProcInfo, sizeof(ProcInfo));
if( !CreateProcess( NULL,
"c:\\program files\\outlook express\\wab.exe",
NULL, NULL, FALSE, 0, NULL, NULL, &StartupInfo, &ProcInfo))
{
ShowMessage("CreateProcess failed.");
}
// Wait until the child process exits
WaitForSingleObject(ProcInfo.hProcess, INFINITE);
CloseHandle(ProcInfo.hProcess);
CloseHandle(ProcInfo.hThread);
}
Rodolfo
Stargate Software
http://members.optusnet.com.au/~rodolfofrino/
"Richard Yu" <richard@colorselector.com> wrote in message
news:3eaef833@newsgroups.borland.com...
> I want to start an exe application from inside my code, how can i do that
?
>
> example : like to start a "aApplication param1 param2", aApplication is
> an exe.
>
> something like shellexecute() ?
>
> thanks for the help.
>
>
Technical Details
Message-ID:
<3eaf16fe@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3eaef833@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,15c2c503d1ca5973 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-04-29 17:28:07 PST From: "StarCinema - Rodolfo Frino" <starcinema@stargate.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3eaef833@newsgroups.borland.com> Subject: Re: how to start an application from inside my code? Date: Wed, 30 Apr 2003 10:17:27 +1000 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 203.164.38.8 Message-ID: <3eaf16fe@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1051662078 203.164.38.8 (29 Apr 2003 17:21:18 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail