2

I have a folder which is displayed in Windows Explorer as:
enter image description here

Inside this folder the hidden desktop.ini has this content:

[.ShellClassInfo]
InfoTip=@Shell32.dll,-12688
IconFile=%SystemRoot%\system32\mydocs.dll
IconIndex=-101

This mydocs.dll actually contains exactly TWO icons, where the second one is the icon used by Windows Explorer to display the above folder.

So shouldn't the last line of the desktop.ini content be IconIndex=1 (supposing Windows starts counting at 0) instead of IconIndex=-101?

I have tried to interpret the -101 value as binary, hexadecimal, octal, but none was translating to a number which would represent the second icon.

So, how is the -101 value pointing to the SECOND icon in mydocs.dll?

user1580348
  • 2,025

1 Answers1

2

The negative IconIndex refers to the inverse of the Resource ID. See this Microsoft dev blog:

In Windows 95, the Extract­Icon function was enhanced so that you could also specify an icon by its resource ID by passing its negative as the icon index.

See also the Microsoft documentation.

In your case, the icon used has a resource ID: 101 and therefore it is shown as -101. After checking my own mydocs.dll, It shows that the resource ID is 101 for the icon you displayed and resource ID: 100 for the first icon (folder with document).

Narvarth
  • 223
Muffin
  • 66