🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16117

Re: DOS

#16117
From: Remy Lebeau (TeamB)
Date: Sat, 31 May 2003 04:09
22 lines
1830 bytes
"Paul Ooi" <ooiyitung@hotmail.com> wrote in message
news:3ed80c07$1@newsgroups.borland.com...
> i don't want the command prompt window to popup in this case

Spawn the new program using CreateProcess().  In the STARTUPINFO structure,
include the STARTF_USESHOWWINDOW flag and then set the wShowWindow member to
SW_HIDE.

> and also be able to receive any messages the DOS
> program has to display to the screen on a, say TMemo.

Again, using CreateProcess() and STARTUPINFO, include the
STARTF_USESTDHANDLES flag and then assign your own I/O handles to the
hStdInput/hStdOutput/hStdError members as needed.  Use CreatePipe() for the
handles you want to override, and use GetStdHandle() for those you don't.
In the case of the hStdOutput pipe, you can then call ReadFile() in a loop
for the lifetime of the new process in order to read any output generated.
Then you can do whatever you want with the buffer you read.


Gambit
Technical Details
Message-ID: <3ed82a63$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ed80c07$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,d9719c21fc8cdc1
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-30 21:18:51 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ed80c07$1@newsgroups.borland.com>
Subject: Re: DOS
Date: Fri, 30 May 2003 21:09:51 -0700
Lines: 24
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: 207.175.226.26
Message-ID: <3ed82a63$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1054354019 207.175.226.26 (30 May 2003 21:06:59 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail