Icons included in AutoHotkey.exe

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
newbieforever
Posts: 493
Joined: 24 Aug 2016, 03:34

Icons included in AutoHotkey.exe

21 Jul 2018, 11:47

Hi!

The icon resource of AutoHotkey.exe include three green H icons (48x48, 32x32, 16x16, all 32 bit) and four light-blue H icons (as for green H and additionally 32x32 4 bit).

What is the exact purpose of each of these icons, for what and when are they used?
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Icons included in AutoHotkey.exe

21 Jul 2018, 17:56

There is one green H icon (RT_GROUP_ICON) which includes three bitmaps (RT_ICON). This icon is shown by Explorer when you look at AutoHotkey.exe or a shortcut to AutoHotkey.exe, or in the Start menu if you have AutoHotkey there, and it is also used by the program's main window, GUI windows and the tray icon. (The window icons are typically shown in the title bar of the window, in the taskbar and in Alt-Tab.)

There is one maroon H icon on a light blue background. This is the icon used by .ahk files if you've installed AutoHotkey.

As with most other icons on Windows, multiple bitmaps are provided for optimal quality in different situations. If the appropriate size or colour depth is unavailable, Windows will pick one (not always the most appropriate one) and convert it on the fly, with sometimes poor results.
newbieforever
Posts: 493
Joined: 24 Aug 2016, 03:34

Re: Icons included in AutoHotkey.exe

17 Aug 2018, 08:14

A short additional question related to the correct terminology:

AutoHotkey.exe contains 'icons' designated as 159, 160, 206, 207, 208 (at least if viewed in ResourceHacker). 'Icons' contained in other executables may be designated by words and/or numbers; ResourceHacker.exe contains two 'icons' designated as MAINICON and 128.

What is the correct name of these numbers/words? Icon 'number' obviously would be a wrong name. It is even obviously incorrect to say that 159 or MAINICON is an 'icon', because 'images' ('bitmaps') contained may be of totally different kind. Is 159 or MAINICON an icon 'group'?
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Icons included in AutoHotkey.exe

18 Aug 2018, 00:31

159 and "MAINICON" are resource IDs or names.

AutoHotkey interprets an IconNumber of (for example) -159 as resource ID 159.
It is even obviously incorrect to say that 159 or MAINICON is an 'icon', because 'images' ('bitmaps') contained may be of totally different kind.
I don't get your point. RT_ICON resources follow a specific format and do not deviate from this format. RT_GROUP_ICON follow a specific format different from RT_ICON resources. RT_ICON is a totally different kind of resource than RT_GROUP_ICON, hence having names for the two resource types and referring to them as different types.

All RT_ICON resources have exactly the same structure, but may contain bitmaps of different sizes or bit-depths. An RT_GROUP_ICON resource is just a list of RT_ICON resources. Within a RT_GROUP_ICON resource, there should never be two RT_ICON resources with the same size and bit-depth, but all resources within the group should represent the same graphic/symbol/icon. The purpose of the group is to allow applications to choose whichever bitmap is ideal for rendering at a particular size and bit-depth.

From the user's perspective - or within the context of the AutoHotkey commands or documentation - the RT_GROUP_ICON resource represents "an icon". You do not identify a specific bitmap (RT_ICON resource) within the file, but just an "icon number" which corresponds to a RT_GROUP_ICON resource. A user selecting "an icon" from an icon dialog will typically not see it as a RT_GROUP_ICON resource, but as an icon. Even Win32 functions such as ExtractIcon identify a RT_GROUP_ICON by index, not an individual RT_ICON.
Is 159 or MAINICON an icon 'group'?
159 and "MAINICON" identify RT_GROUP_ICON resources. Resource Hacker 4.2.5 names this type of resource an "Icon Group". If you want to avoid ambiguity, you can refer to a resource by its ID and the symbolic name of its resource type as defined in the SDK (RT_ whatever).
newbieforever
Posts: 493
Joined: 24 Aug 2016, 03:34

Re: Icons included in AutoHotkey.exe

18 Aug 2018, 03:54

In other words:

xxx = ... ?
yyy = ... ?

"ResourceHacker.exe contains 2 xxx which are: MAINICON, 128."
"The xxx 'MAINICON' contains 6 yyy."

"AutoHotkey.exe contains 5 xxx which are: 159, 160, 206, 207, 208."
"The xxx '159' contains 3 yyy."

RH0.JPG
(36.99 KiB) Downloaded 161 times
"MAINICON":
RH1.JPG
(26.96 KiB) Downloaded 161 times
"128":
RH2.JPG
(9.87 KiB) Downloaded 161 times
PS: "It is even obviously incorrect to say that 159 or MAINICON is an 'icon', because 'images' ('bitmaps') contained may be of totally different kind."
I meant: 5 of the images ("icons") contained in MAINICON are the same "picture" ("icon") in different sizes, but the 6th is a completely different "picture" ("icon").
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Icons included in AutoHotkey.exe

18 Aug 2018, 21:45

I already answered your question in detail. If you can't complete the homework (fill in the blanks) by yourself, I've apparently wasted my time.
but the 6th is a completely different "picture" ("icon").
They are all representations of the same thing, and are used interchangeably, even if the artist breaks convention and inserts an image that looks nothing like the others.
newbieforever
Posts: 493
Joined: 24 Aug 2016, 03:34

Re: Icons included in AutoHotkey.exe

19 Aug 2018, 07:52

lexikos wrote:... I've apparently wasted my time.
Oh no, you can not waste your time here in this forum! I'm not relevant here! Certainly hundreds of other members have fully understood your explanation and have been able to complete their understanding.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], jaka1, MrDoge and 245 guests