From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7606 invoked by alias); 21 Feb 2012 20:40:17 -0000 Received: (qmail 7594 invoked by uid 22791); 21 Feb 2012 20:40:15 -0000 X-SWARE-Spam-Status: No, hits=3.2 required=5.0 tests=AWL,BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_HW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nm16-vm0.bullet.mail.bf1.yahoo.com (HELO nm16-vm0.bullet.mail.bf1.yahoo.com) (98.139.212.253) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 21 Feb 2012 20:40:00 +0000 Received: from [98.139.212.151] by nm16.bullet.mail.bf1.yahoo.com with NNFMP; 21 Feb 2012 20:39:59 -0000 Received: from [98.139.212.228] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 21 Feb 2012 20:39:59 -0000 Received: from [127.0.0.1] by omp1037.mail.bf1.yahoo.com with NNFMP; 21 Feb 2012 20:39:59 -0000 Received: (qmail 50355 invoked by uid 60001); 21 Feb 2012 20:39:59 -0000 Received: from [98.64.195.174] by web162104.mail.bf1.yahoo.com via HTTP; Tue, 21 Feb 2012 12:39:59 PST References: <1329596319.47207.YahooMailNeo@web162105.mail.bf1.yahoo.com> <1329808688.9185.YahooMailNeo@web162103.mail.bf1.yahoo.com> Message-ID: <1329856799.42733.YahooMailNeo@web162104.mail.bf1.yahoo.com> Date: Tue, 21 Feb 2012 20:40:00 -0000 From: Kevin Schnitzius Reply-To: Kevin Schnitzius Subject: Re: mintty window handle To: "cygwin@cygwin.com" In-Reply-To: <1329808688.9185.YahooMailNeo@web162103.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-02/txt/msg00638.txt.bz2 >From: Kevin Schnitzius=20 > >I would like to be able change the icon dynamically on my mintty=20 >windows.=A0 However, old trick (google KB125103) for finding console=20 >window handles won't work anymore as it relies on the windows console=20 >window.=A0 I have verified that WM_SETICON works with the correct window h= andle.=A0 I have played=20 >around with the walking through windows but I can't figure out how to do i= t. For those curious, this MSVC solution worked: =A0=A0=A0=A0=A0=A0=A0 // Format a "unique" NewWindowTitle. =A0=A0=A0=A0=A0=A0=A0 sprintf(pszNewWindowTitle, "%d/%d", =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 GetTickCount(), GetCurrentProcessId()); =A0=A0=A0=A0=A0=A0=A0 sprintf(pszNewCommand, "c:\\cygwin\\bin\\bash.exe -c = \'echo -ne \"\\e]2;%s\\a\"\'", pszNewWindowTitle); =A0=A0=A0=A0=A0=A0=A0 system(pszNewCommand); =A0=A0=A0=A0=A0=A0=A0 // Ensure window title has been updated. =A0=A0=A0=A0=A0=A0=A0 Sleep(40); =A0=A0=A0=A0=A0=A0=A0 // Look for NewWindowTitle. =A0=A0=A0=A0=A0=A0=A0 hwndFound =3D FindWindow(NULL, pszNewWindowTitle);=A0= // our program There is no way that I know of to get the original title so I had to make m= y program set the title to something meaningful=20 while changing the icon.=A0 There are other difficulties as well when freei= ng icon handles but I have a solution if anyone is interested. Kevin -- 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