This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: creating new window at program startup [OFF-TOPIC]?

On Tue, 4 Apr 2000 13:45:06 -0400,  Chris Faylor <cgf at cygnus dot com>

>On Tue, Apr 04, 2000 at 02:41:11AM -0700, Michele Liberi wrote:
>>launching from 'command' or 'cmd' an application created without -mwindows
>>flag involves the creation of a new window.
>>I would like to create the new window only if I need it. How may I control
>>the creation of the new window without generating two versions of the
>I'm sorry.  This is off-topic for this mailing list.  Try one of
>the general-purpose windows programming mailing lists or newsgroups.
>You should be able to find information at

I know Chris is the arbiter of on/off-topicness but I also used to think that it was reasonable to expect that it should be possible to create a Cygwin program such that when launched from a command prompt it uses that window for its standard I/O, or otherwise creates a new window for its standard I/O. It also seemed reasonable that this possibility would depend on the run-time library (eg, the start-up code) and hence Cygwin.

Only after considerable disappointment did it become clear that this is not simply achievable given the Microsoft execution model, apparently for any development environment:

-	if you link for the GUI subsystem (implied by -mwindows), the program can never know about the console from which it was started

-	if you link for the console subsystem, a new console will _always_ be created, whether or not standard I/O is performed.

What may be a reasonable solution is demonstrated by the rxvt port linked from the Cygwin page, where (IIRC) a hidden console (eg for bash) is mirrored in a visible GUI window.


Want to unsubscribe from this list?
Send a message to

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]