public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Kevin Schnitzius <kometes@yahoo.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: mintty window handle
Date: Tue, 21 Feb 2012 20:40:00 -0000	[thread overview]
Message-ID: <1329856799.42733.YahooMailNeo@web162104.mail.bf1.yahoo.com> (raw)
In-Reply-To: <1329808688.9185.YahooMailNeo@web162103.mail.bf1.yahoo.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

  parent reply	other threads:[~2012-02-21 20:40 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 [this message]
2012-02-22  2:05     ` Andrey Repin

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=1329856799.42733.YahooMailNeo@web162104.mail.bf1.yahoo.com \
    --to=kometes@yahoo.com \
    --cc=cygwin@cygwin.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).