1

I wish to customize my own folder style, I tried to make the folder get remarks by modifying the LocalizedResourceName property in desktop.ini.

I try to set LocalizedResourceName to a Chinese string. But it is displayed as garbled characters when it is actually displayed.

I noticed the following code in the desktop.ini of the system folder: LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21798

So I try to write a .dll file by myself, encapsulate the icon and string, and use it.

I already know how to make a resource-only dll file, but I don't know how to get a certain resource in the file. (ie, get the number -21798 in the above example code)

How should I do ?

CaulCaul
  • 13
  • 3

1 Answers1

1

By convention, a positive resource number is an index (0 is the first resource etc.) and negative numbers are resource ids. In this specific case, it is the string resource with the id of abs(-21798) that Windows would pass to LoadString.

If you want to create your own .dll, add a string with an id of 2 for example (any number between 2 and 0xffff) and in your .ini you would use @c:\path\mydll.dll,-2.

Before you go to all this trouble, just try saving the .ini as UTF-16 LE (Unicode in Notepad) and use Chinese strings directly without the @.

Anders
  • 97,548
  • 12
  • 110
  • 164
  • Thank you! Now I really can use the strings in my dll. And saving the .ini file as UTF-16 LE is indeed an easier method that I hadn't thought of before. And by the way, Do you know where there is documentation detailing the entries in the `deaktop.ini` file? I found the following website: `https://learn.microsoft.com/en-us/windows/win32/shell/how-to-customize-folders-with-desktop-ini` But only a limited number of items are introduced. – CaulCaul Feb 13 '22 at 06:49