Changing a folder icon does not take effect

I change the default system folder icon using the registry key

Reg := TRegistry.Create; try Reg.RootKey := HKEY_LOCAL_MACHINE; Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons', True); Reg.WriteString('3', 'C:\MyIcon.icl,0'); finally RegFile.Free; end; 

I can change the registry values, but the problem is that I need to restart the OS for it to take effect.

To fix this, I tried:

 SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0); 

and:

 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil); 

It works on WinXP, but not on Win7.

How can I fix this on Win7?

+4
source share
1 answer

Try to "complete the task" in the process "explorer.exe" from the task manager,

and run it again (Run → explorer.exe),

If as a result of this process you see updated icons, try to do this programmatically so that you do not have to restart.

+1
source

Source: https://habr.com/ru/post/1435515/


All Articles