X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 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: <20090626102313.GA12963@calimero.vinschen.de>
References: <20090415153549.GA8722@calimero.vinschen.de> 	 <416096c60904151415k6998673dw2ddf867653ae88e8@mail.gmail.com> 	 <20090416092528.GB8722@calimero.vinschen.de> 	 <416096c60904210835jd93a1b8w742bb8ebe0802c9c@mail.gmail.com> 	 <20090421160026.GJ8722@calimero.vinschen.de> 	 <20090508090737.GA15230@calimero.vinschen.de> 	 <416096c60905131134l21aa53dqe7c3f99130dddb4e@mail.gmail.com> 	 <20090626083640.GF30864@calimero.vinschen.de> 	 <416096c60906260239r5bdaf60bw6a9febe885726f55@mail.gmail.com> 	 <20090626102313.GA12963@calimero.vinschen.de>
Date: Fri, 26 Jun 2009 13:03:15 +0100
Message-ID: <416096c60906260503o52ae73ben1140bbbd2db993bb@mail.gmail.com>
Subject: Re: popup consoles on Windows 7
From: Andy Koppe <andy.koppe@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

2009/6/26 Corinna Vinschen:
>> The proper, yet probably completely impractical solution: compile
>> Cygwin programs for the GUI subsystem instead of the console one and
>> attach to the parent process' console, if any, with explicit calls at
>> program startup. POSIX programs don't use the Win32 console API, so
>> there should be no need to always have a console available.
>
> The problem is rather that you want to be able to run certain native
> applications which refuse to run if no console is allocated. =C2=A0Or they
> pop up a console on their own.

Good point, that would be rather an unwelcome change. Shame.


>> Otherwise:
>>
>> =C2=A0 =C2=A0 DWORD version =3D GetVersion();
>> =C2=A0 =C2=A0 version =3D ((version & 0xff) << 8) | ((version >> 8) & 0x=
ff);
>> =C2=A0 =C2=A0 if (version >=3D 0x0601 && AllocConsole())
>> =C2=A0 =C2=A0 =C2=A0 ShowWindowAsync(GetConsoleWindow(), SW_HIDE);
>>
>> Still looks bad though, with "subliminal" popups, as demonstrated by
>> mintty on Windows 7.
>
> And what's really bad is that the console shows up in the taskbar.

Forgot to say: the occurances of this could at least be reduced by
trying AttachConsole to get a hold on the parent process' console, if
any. When I attempted that in MinTTY, though, I couldn't make it work.
Did you previously mention that MS fixed bug in this area?

Andy

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

