From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Can I change the windows icon from command line?
Date: Thu, 02 Nov 2017 02:39:00 -0000 [thread overview]
Message-ID: <7362515c-61fe-bf66-2871-cbf4a11883b5@SystematicSw.ab.ca> (raw)
In-Reply-To: <24a5fd8b-b9d1-b7c0-1c0c-b0ec96159ce8@towo.net>
On 2017-11-01 15:10, Thomas Wolff wrote:
> Am 01.11.2017 um 22:05 schrieb bzs@theworld.com:
>> A trivial little shell script I use for setting xterm title/icon via escape
>> sequences:
>> ...
> That sequence is setting the icon *label*, not the icon. Mintty cannot support
> it because there is no corresponding Windows function.
But there is a sequence of Windows functions from:
http://www.cplusplus.com/forum/general/28470/
summarizing (but this is from 2010 so may need tweaks):
"There are two icons in the window, 32x32 and 16x16.
If you want to change the the icon at the task bar and title bar you should do:
hIcon = (HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32,
LR_LOADFROMFILE);
hIconSm = (HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 16, 16,
LR_LOADFROMFILE);
LoadImage just loads the icon from the file. You need to assign the icon to the
window. You do this by sending a WM_SETICON message:
SendMessage( yourwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm );
SendMessage( yourwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon );
Reference: http://msdn.microsoft.com/en-us/library/ms632643(VS.85).aspx
I found out the difference with the ICON_SMALL and ICON_BIG, if you only set
ICON_SMALL then the Alt-Tab icon is stretched and looks bad.
If you set the ICON_BIG as well as ICON_SMALL, then everything looks nice."
For Xwindow icons, some approaches from google, depending on needs:
http://www.ideatrash.net/2014/10/howto-get-custom-icons-with-each-new.html
http://www.troubleshooters.com/linux/terminal_icon.htm
http://blog.samadamday.com/2014/automatically-set-windows-icons-based-on-gnome-theme/
https://superuser.com/questions/344320/how-do-i-change-the-icon-of-an-xterm
http://www.leonerd.org.uk/code/xseticon/
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
--
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
next prev parent reply other threads:[~2017-11-02 2:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-01 2:42 P RC
2017-11-01 6:08 ` Brian Inglis
2017-11-01 20:59 ` Thomas Wolff
2017-11-01 21:06 ` bzs
2017-11-01 21:10 ` Thomas Wolff
2017-11-02 2:39 ` Brian Inglis [this message]
2017-11-02 6:47 ` Thomas Wolff
2017-11-02 10:20 ` Andrey Repin
2017-11-02 19:53 ` Thomas Wolff
2017-11-02 13:38 ` cyg Simple
2017-11-02 19:55 ` Thomas Wolff
2017-11-03 15:34 ` cyg Simple
2017-11-03 19:23 ` Thomas Wolff
2017-11-03 20:03 ` cyg Simple
2017-11-03 21:29 ` Thomas Wolff
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=7362515c-61fe-bf66-2871-cbf4a11883b5@SystematicSw.ab.ca \
--to=brian.inglis@systematicsw.ab.ca \
--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).