[TC 11.57] New feature Icon Index Field do not support negative numbers

Here you can propose new features, make suggestions etc.

Moderators: Stefan2, Hacker, petermad

Post Reply
User avatar
Mapaler
Junior Member
Junior Member
Posts: 28
Joined: 2022-01-29, 06:05 UTC

[TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *Mapaler »

Background
In Total Commander, the Icon Index represents the resource sequence number rather than the ID, which can cause the resource with the same ID to be misaligned when the number of resources changes due to different DLL versions.

For example, this red cross in the picture below has an index that is one higher in Win11 than in Win10, causing my icons to display inconsistently across different systems.
Image: https://github.com/user-attachments/assets/b5a06f64-a491-4294-b02f-9a0fe7e9a39c

So later I found out that you can use a negative sign to represent a resource ID to point to an icon, and this ID will not be changed by Microsoft, just like the desktop.ini in Windows' default folders. For example, in C:\Users\[User Name]\Desktop\desktop.ini, IconResource points to the desktop icon.

Code: Select all

[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769
IconResource=%SystemRoot%\system32\imageres.dll,-183
So I modified my bar source code to use resource IDs to ensure consistent behavior across different operating systems. :D
Image: https://github.com/user-attachments/assets/4ed999e1-c629-4a04-9afc-32b32ca7d00f

In 11.57
The icon index field in the text area will forcibly use positive numbers, causing any modifications I make to the bar to change negative IDs to 0, thereby losing the icons I specified. :(
Image: https://github.com/user-attachments/assets/ea29b63e-5d29-47d1-89ae-0cd662797202
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *ghisler(Author) »

This is just a quick search field to jump to the correct icon. A negative index is not supported. Negative numbers usually mean the resource number.
20.02.26 Added: Configuration - Button bar: The icon index field is now an edit box and can be used for quick search (32/64)
I will therefore move this thread to suggestions.

Moderator message from: ghisler(Author) » 2026-05-10, 07:58 UTC

Moved to suggestions
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 17375
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *petermad »

Support++ for adding support for resource numbers
License #524 1994
Danish TC Translator
TC 11.58 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1416b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Mapaler
Junior Member
Junior Member
Posts: 28
Joined: 2022-01-29, 06:05 UTC

Re: [TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *Mapaler »

In previous versions, although you couldn't directly select negative numbers, it wouldn't modify the negative numbers in my source file.

Version 11.57 forces the clicked icon's negative number to become 0, so it changes the previous behavior.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *ghisler(Author) »

You are right, that's a regression. I will change it.
Author of Total Commander
https://www.ghisler.com
User avatar
Sombra
Power Member
Power Member
Posts: 819
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Re: [TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *Sombra »

ghisler(Author) wrote: 2026-05-13, 07:44 UTC You are right, that's a regression. I will change it.
That makes sense, as it was possible before. Just as that option is already available for the ‘internal association’ feature.
viewtopic.php?t=87138

Thank you for reconsidering.
User avatar
Sombra
Power Member
Power Member
Posts: 819
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Re: [TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *Sombra »

history.txt wrote:13.05.26 Fixed: Configure button bar/single button: The editable index field didn't support negative numbers, which are used to set icons by resource id (32/64)
It is working fine in the new version TC 11.57a RC1. Thanks!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *ghisler(Author) »

Please also check whether the icon preview works in your case:
1. When opening the dialog with an icon which has a negative index (resource id), the icon should be highlighted in the lower list at its position. For example, if resource ID 110 (value given: -110) is at position 10, then the 10th icon should be highlighted.
2. When entering a negative number, the correct icon should also be highlighted, except when no resource with that number exists. for example, when you enter -10000, no icon would be highlighted.
3. When going with tab to the icon list, the negative number should not change
4. When you then press the cursor keys to go to a different icon, that icon's positive index should appear in the edit box.
Author of Total Commander
https://www.ghisler.com
User avatar
Sombra
Power Member
Power Member
Posts: 819
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Re: [TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *Sombra »

1. When opening the dialog with an icon which has a negative index (resource id), the icon should be highlighted in the lower list at its position. For example, if resource ID 110 (value given: -110) is at position 10, then the 10th icon should be highlighted.
Yes, it works as described.
2. When entering a negative number, the correct icon should also be highlighted, except when no resource with that number exists. for example, when you enter -10000, no icon would be highlighted.
Confirmed.
3. When going with tab to the icon list, the negative number should not change
Yes, the negative number for index remains as you navigate using the Tab or Shift+TAB keys.
4. When you then press the cursor keys to go to a different icon, that icon's positive index should appear in the edit box.
Confirmed too, when the focus is on the list of icons at the bottom.

Just for information, though this isn’t particularly relevant as, if I recall correctly, the following feature wasn’t available in previous versions either: an extended command with an icon defined by a negative ID does not display the icon in the toolbar or in the menus.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57] New feature Icon Index Field do not support negative numbers

Post by *ghisler(Author) »

an extended command with an icon defined by a negative ID does not display the icon in the toolbar or in the menus
Indeed this isn't currently supported. I will check whether I can support that too, shouldn't be too difficult.
Author of Total Commander
https://www.ghisler.com
Post Reply