www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/29/13:21:53

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <49CFB989.9040308@gmail.com>
References: <416096c60903291050r44203e40j19a83d16aebabb3d AT mail DOT gmail DOT com> <49CFB989 DOT 9040308 AT gmail DOT com>
Date: Sun, 29 Mar 2009 19:21:39 +0100
Message-ID: <416096c60903291121w1e4ba39ch96c738153c74646@mail.gmail.com>
Subject: Re: -mwindows and --Wl,subsystem,windows
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Dave Korn:
> Andy Koppe wrote:
>> According to this post on the gcc mailing list a few years back, gcc's
>> -mwindows option should imply --Wl,subsystem,windows:
>>
>> http://gcc.gnu.org/ml/gcc-help/2004-01/msg00225.html
>
> =A0 Yep, it still does.

Ah, you're right. I seem to have confused myself about this while
grappling with MinTTY issue 39: "Command shell window remains open in
Windows 7 Beta".

It would appear that something's changed in how Windows deals with
Cygwin applications. The fact that MinTTY actually is compiled as a
"windows" subsystem app after all makes this even more curious.

I'm finding that MinTTY itself causes a console to open without any
output that would necessitate it. That can be got rid of with
FreeConsole(), but then the command invoked by MinTTY (using forkpty()
and execve()) opens a console anyway. Apart from that, things work
fine though.

rxvt uses the hack below to just hide any console window. Perhaps I
should just go with that, but I'm a bit concerned that it might end up
hiding the wrong console, or that the console might reappear for some
reason anyway.

Andy


char app_name[40];
sprintf(app_name, "rxvt%08x", (unsigned int)GetCurrentThreadId());
...
SetConsoleTitle( app_name );
while ((conwin =3D FindWindow( NULL, app_name))=3D=3DNULL)
    Sleep( 40 );
ShowWindowAsync(conwin, SW_HIDE);

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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