Article View: borland.public.cppbuilder.nativeapi
Article #12503Re: Execute DOS application
From: George
Date: Tue, 09 Dec 2003 12:39
Date: Tue, 09 Dec 2003 12:39
39 lines
2288 bytes
2288 bytes
My code doesn't work:
STARTUPINFO StartupInfo;
setmem(&StartupInfo, sizeof(STARTUPINFO), 0);
StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.hStdInput = reinterpret_cast <HANDLE> (STD_INPUT_HANDLE);
StartupInfo.hStdOutput = NULL;
StartupInfo.hStdError = NULL;
StartupInfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
StartupInfo.wShowWindow = SW_HIDE;
PROCESS_INFORMATION ProcessInformation;
setmem(&ProcessInformation, sizeof(PROCESS_INFORMATION), 0);
bool Created = CreateProcess(MyExe.c_str(), MyParams.c_str(), 0, 0, true,
CREATE_DEFAULT_ERROR_MODE, 0, 0, &StartupInfo, &ProcessInformation);
if(Created) {
WaitForSingleObject(ProcessInformation.hProcess, INFINITE);
CloseHandle(ProcessInformation.hProcess);
CloseHandle(ProcessInformation.hThread);
}
Maybe that "<" pipe ?
Thanks
"nicolasr" <nicolasrNOSPAMATSIGNgmx.net> wrote in message
news:3fd5ad82$1@newsgroups.borland.com...
> Hi,
>
> CreateProcess might do this. It is passed a STARTUPINFO
> struct which has a wShowWindow element. This can contain
> any flag from the ShowWindow() API and there is a
> SW_HIDE flag.
> (untested)
>
> Nick
>
>
Technical Details
Message-ID:
<3fd5c289@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3fd5ac1f$1@newsgroups.borland.com> <3fd5ad82$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,714ec80889168aad X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-12-09 04:47:47 PST From: "George" <george@nospam.org> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fd5ac1f$1@newsgroups.borland.com> <3fd5ad82$1@newsgroups.borland.com> Subject: Re: Execute DOS application Date: Tue, 9 Dec 2003 14:39:35 +0200 Lines: 41 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 213.16.182.60 Message-ID: <3fd5c289@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1070973577 213.16.182.60 (9 Dec 2003 04:39:37 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail