🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.nativeapi
Article #201

How to prevent spawned console window from closing application?

#201
From: Murray McCulloch
Date: Wed, 02 Jun 2004 19:02
12 lines
1410 bytes
I have an application (a DLL to be specific) which creates a console,
executes a console program, reads its output and sends keypresses to
it. I do this with AllocConsole(), CreateProcess(),
ReadConsoleOutputCharacter() and keybd_event().

Everything works nicely, except for one little problem. If the user
manually closes the console window, my entire application exits
immediately. Is there some simple way I can prevent this, or do I have
to start messing with intercepting messages?

Thanks,
Murray
Technical Details
Message-ID: <9fa254af.0406021102.5d91f4fe@posting.google.com>
Path: arc1-ca.pugleaf.net!controlnews3.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f94dd,78d56b31d2cd7419,start
X-Google-Thread: 14438e,1b258aeefa9b2910,start
X-Google-Attributes: gidf94dd,gid14438e,public
Path: arc1-ca.pugleaf.net!controlnews3.google.com!postnews1.google.com!not-for-mail
From: mrmdotnet@yahoo.com (Murray McCulloch)
Newsgroups: borland.public.delphi.nativeapi,borland.public.delphi.nativeapi.win32
Subject: How to prevent spawned console window from closing application?
Date: 2 Jun 2004 12:02:41 -0700
Organization: http://groups.google.com
Lines: 12
Message-ID: <9fa254af.0406021102.5d91f4fe@posting.google.com>
NNTP-Posting-Host: 12.173.168.196
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1086202962 2434 127.0.0.1 (2 Jun 2004 19:02:42 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 2 Jun 2004 19:02:42 +0000 (UTC)