X-Recipient: archive-cygwin AT delorie DOT com 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 References: <1329596319 DOT 47207 DOT YahooMailNeo AT web162105 DOT mail DOT bf1 DOT yahoo DOT com> <1329808688 DOT 9185 DOT YahooMailNeo AT web162103 DOT mail DOT bf1 DOT yahoo DOT com> Message-ID: <1329856799.42733.YahooMailNeo@web162104.mail.bf1.yahoo.com> Date: Tue, 21 Feb 2012 12:39:59 -0800 (PST) From: Kevin Schnitzius Reply-To: Kevin Schnitzius Subject: Re: mintty window handle To: "cygwin AT cygwin DOT com" In-Reply-To: <1329808688.9185.YahooMailNeo@web162103.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q1LKeMXu009996 >From: 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 There is no way that I know of to get the original title so I had to make my program set the title to something meaningful while changing the icon.  There are other difficulties as well when freeing 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