Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@sourceware.cygnus.com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin@sourceware.cygnus.com>
List-Help: <mailto:cygwin-help@sourceware.cygnus.com>,
	<http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
From: "Josh Baudhuin" <joshb@Cadence.COM>
To: <cygwin@sourceware.cygnus.com>
Subject: RE: console window on demand?
Date: Tue, 10 Aug 1999 17:30:24 -0700
Message-ID: <NDBBLGOPELKNGBJPMCEPGENJCGAA.joshb@cadence.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
Importance: Normal
In-Reply-To: <9908102356.AA14944@nga.nga.com>

You can use the Win32 API's AllocConsole() to create a console. You'd likely need
to attach the std handles to it (or, rather, override the existing ones to spit out
to the console), though, which is doable.

-----Original Message-----
From: cygwin-owner@sourceware.cygnus.com
[mailto:cygwin-owner@sourceware.cygnus.com]On Behalf Of Jim Roy
Sent: Tuesday, August 10, 1999 4:57 PM
To: cygwin@sourceware.cygnus.com
Subject: console window on demand?


I there any way to get a console window "on demand"?

I have a simple character based program that I am trying to
port to windows.  It is executed from a third party shell.
Under X, it pops an xterm when it actually writes output, but
does not if no output is produced.  I can't seem to get similar
behavior in windows.

If I compile it as a "console" pgm, ie without -mwindows, then
printf() etc all function as expected and life is good.  Except
that a window pops up on startup, even if no actual output is
produced.

If I compile it as a "GUI" pgm, I lose the gratituitous startup
window, but console I/O has to be done via windows API calls.

Am I missing something here?  Is there a way to use printf() &
friends in a GUI setting?  Or better yet, is there a way to
start a "console" mode pgm without an attached console, and have
it be created with the first I/O opperation?

Thanks for your time,

Jim Roy


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

