I am changing the icons in a folder using the C # function. His work is great, but the problem is that he works for the first time. I mean, I cannot change the icon for the folder for which I have already changed the icon. Here is the code below:
static void Main(string[] args) { LPSHFOLDERCUSTOMSETTINGS FolderSettings = new LPSHFOLDERCUSTOMSETTINGS(); FolderSettings.dwMask = 0x10; FolderSettings.pszIconFile = @"C:\Program Files (x86)\Common Files\TortoiseOverlays\icons\XPStyle\ModifiedIcon.ico"; FolderSettings.iIconIndex = 0; UInt32 FCS_READ = 0x00000001; UInt32 FCS_FORCEWRITE = 0x00000002; UInt32 FCS_WRITE = FCS_READ | FCS_FORCEWRITE; string pszPath = @"D:\Downloaded Data"; UInt32 HRESULT = SHGetSetFolderCustomSettings(ref FolderSettings, pszPath, FCS_WRITE);
What could be the reason?
source share