This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: mintty window handle
- From: Kevin Schnitzius <kometes at yahoo dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Tue, 21 Feb 2012 12:39:59 -0800 (PST)
- Subject: Re: mintty window handle
- References: <1329596319.47207.YahooMailNeo@web162105.mail.bf1.yahoo.com> <1329808688.9185.YahooMailNeo@web162103.mail.bf1.yahoo.com>
- Reply-to: Kevin Schnitzius <kometes at yahoo dot com>
>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