X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=1.8 required=5.0	tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_THEBAT,TW_HW
X-Spam-Check-By: sourceware.org
Date: Wed, 22 Feb 2012 05:50:27 +0400
From: Andrey Repin <anrdaemon@freemail.ru>
Reply-To: Andrey Repin <cygwin@cygwin.com>
Message-ID: <1409512550.20120222055027@mtu-net.ru>
To: Kevin Schnitzius <kometes@yahoo.com>, cygwin@cygwin.com
Subject: Re: mintty window handle
In-Reply-To: <1329856799.42733.YahooMailNeo@web162104.mail.bf1.yahoo.com>
References: <1329596319.47207.YahooMailNeo@web162105.mail.bf1.yahoo.com> <1329808688.9185.YahooMailNeo@web162103.mail.bf1.yahoo.com> <1329856799.42733.YahooMailNeo@web162104.mail.bf1.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
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
Note-from-DJ: This may be spam

Greetings, Kevin Schnitzius!

>>I would like to be able change the icon dynamically on my mintty
>>windows.  However, old trick (google KB125103) for finding console 
>>window handles won't work anymore as it relies on the windows console 
>>window.  I have verified that WM_SETICON works with the correct window handle.  I have played 
>>around with the walking through windows but I can't figure out how to do it.

> For those curious, this MSVC solution worked:

>         // Format a "unique" NewWindowTitle.
>         sprintf(pszNewWindowTitle, "%d/%d",
>             GetTickCount(), GetCurrentProcessId());

>         sprintf(pszNewCommand, "c:\\cygwin\\bin\\bash.exe -c \'echo -ne \"\\e]2;%s\\a\"\'", pszNewWindowTitle);
>         system(pszNewCommand);

>         // Ensure window title has been updated.
>         Sleep(40);

>         // Look for NewWindowTitle.
>         hwndFound = FindWindow(NULL, pszNewWindowTitle);  // our program

That's a very ugly way that was appropriate for finding console windows.
For normal GUI windows, I think, there's more straightforward ways.


--
WBR,
Andrey Repin (anrdaemon@freemail.ru) 22.02.2012, <05:48>

Sorry for my terrible english...


--
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

