public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@freemail.ru>
To: Kevin Schnitzius <kometes@yahoo.com>, cygwin@cygwin.com
Subject: Re: mintty window handle
Date: Wed, 22 Feb 2012 02:05:00 -0000	[thread overview]
Message-ID: <1409512550.20120222055027@mtu-net.ru> (raw)
In-Reply-To: <1329856799.42733.YahooMailNeo@web162104.mail.bf1.yahoo.com>

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

      reply	other threads:[~2012-02-22  2:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-18 20:18 Kevin Schnitzius
     [not found] ` <1329808688.9185.YahooMailNeo@web162103.mail.bf1.yahoo.com>
2012-02-21 20:40   ` Kevin Schnitzius
2012-02-22  2:05     ` Andrey Repin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409512550.20120222055027@mtu-net.ru \
    --to=anrdaemon@freemail.ru \
    --cc=cygwin@cygwin.com \
    --cc=kometes@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).