delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/04/05/09:24:41

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <200004051323.OAA07790@cav.logica.co.uk>
Date: Wed, 05 Apr 2000 14:23:48 +0000
To: cygwin AT sourceware DOT cygnus DOT com
From: "Dirk Fieldhouse" <fieldhouse AT acm DOT org>
Subject: Re: creating new window at program startup [OFF-TOPIC]?
Organization: Speaking personally
X-Mailer: Opera 4.0 build 676
X-Priority: 3 (Normal)
Mime-Version: 1.0

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

>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
>>executable?
>
>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 www.deja.com.

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.

/df

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019