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?
source share