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 To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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/