This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can I change the windows icon from command line?

On 2017-11-01 15:10, Thomas Wolff wrote:
> Am 01.11.2017 um 22:05 schrieb
>> 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:

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,
	hIconSm = (HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 16, 16,

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 );


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:

Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]