public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* console window on demand?
@ 1999-08-10 16:56 Jim Roy
  1999-08-10 17:30 ` Josh Baudhuin
  1999-08-31 23:49 ` Jim Roy
  0 siblings, 2 replies; 4+ messages in thread
From: Jim Roy @ 1999-08-10 16:56 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: console window on demand?
  1999-08-10 16:56 console window on demand? Jim Roy
@ 1999-08-10 17:30 ` Josh Baudhuin
  1999-08-31 23:49   ` Josh Baudhuin
  1999-08-31 23:49 ` Jim Roy
  1 sibling, 1 reply; 4+ messages in thread
From: Josh Baudhuin @ 1999-08-10 17:30 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: console window on demand?
  1999-08-10 17:30 ` Josh Baudhuin
@ 1999-08-31 23:49   ` Josh Baudhuin
  0 siblings, 0 replies; 4+ messages in thread
From: Josh Baudhuin @ 1999-08-31 23:49 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* console window on demand?
  1999-08-10 16:56 console window on demand? Jim Roy
  1999-08-10 17:30 ` Josh Baudhuin
@ 1999-08-31 23:49 ` Jim Roy
  1 sibling, 0 replies; 4+ messages in thread
From: Jim Roy @ 1999-08-31 23:49 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-08-31 23:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-10 16:56 console window on demand? Jim Roy
1999-08-10 17:30 ` Josh Baudhuin
1999-08-31 23:49   ` Josh Baudhuin
1999-08-31 23:49 ` Jim Roy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).