Abandon the default icons of Windows and let the directory where your program is located have a personalized FolderIcon! In fact, it is very simple to do. In fact, you only need one Desktop.ini file. I will explain it from two aspects below.
1. Manual method:
First, create a Desktop.ini file in the folder that needs to be changed. An example is as follows:
explain:
The parameter ConfirmFileOp is set to 0 - to prevent the "You are deleting the system directory" warning that pops up when the user moves or deletes this folder.
The parameter IconFile specifies the location of the icon file to be changed, which can be an Icon, Bmp, exe or dll file. The icon file in the above example is also placed in the same directory.
The parameter IconIndex can specify the index of the file. If the icon file is an Icon file, IconIndex is set to 0.
The parameter InfoTip is used to set the Tooltip of this Folder in Windows.
Next open CMD (Command Prompt) and enter:
i:/MyFolder refers to the path of the directory where I want to change the icon. This operation makes your folder a system folder.
Ok, the style of the directory has been changed after manual processing.
2. Programming method:
This method is implemented using VB, which I like, and it is equally easy to implement.
Only two API functions are needed, one is used to operate the creation of Ini files, and the function of the other is equivalent to attrib s in manual mode.
What needs further explanation is:
Can be changed to:
If you are using the icon of the main window, the index of the icon of the VB compiled program is also 0. ->