mintty window handle
Andrey Repin
anrdaemon@freemail.ru
Wed Feb 22 02:05:00 GMT 2012
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
More information about the Cygwin
mailing list