I really liked the oxygen appearance of KDE SC 4. I wrote a program to apply these icons to windows. The program is written in NSIS, and is currently nearly fully functional. However, the only way I found to make Windows aware of the icon changes is to kill explorer.exe, delete the icon cache, and respawn explorer.exe. SHChangeNotify
with SHCNE_ASSOCCHANGED
seems to be unable to make Windows aware of the changes to the Control Panel icon, the My Computer icon, etc. Please suggest a better, less brutal approach to make Windows aware of these changes.
EDIT: I found a program called Icon Tweaker that appears to be able to do this, but it is closed source and so I have no idea how it does this. (IconTweaker: http://www.crystalxp.net/galerie/en.id.83-icontweaker.html)
EDIT: I have this working fine, thanks to Anders' reply (see below). However, I'll just put my working NSIS code here,in case someone else needs it
ReadRegStr $0 HKCU "Control Panel\Desktop\WindowMetrics" "Shell Icon Size"
IntOp $0 $0 + 1
WriteRegStr HKCU "Control Panel\Desktop\WindowMetrics" "Shell Icon Size" $0
SendMessage 0xffff 0x001A 42 0 /TIMEOUT=100000
IntOp $0 $0 - 1
WriteRegStr HKCU "Control Panel\Desktop\WindowMetrics" "Shell Icon Size" $0
SendMessage 0xffff 0x001A 42 0 /TIMEOUT=100000
The $0 register is used to store the Shell Icon Size
value of HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics
. We then increment the value and do a SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS, 0, SMTO_ABORTIFHUNG, 100000, NULL)
, followed by a decrement and re-send.
EDIT: As a bonus, this can be used as a hack to get larger (Windows 7 size) desktop icons on Windows XP. Just double the Shell Icon Size
value and call SendMessage
(don't perform the second change that restores the size)
Go to C:\Users\User\AppData\Local\Microsoft\Windows\Explorer , where C:\ is the drive where you installed Windows 8 or 8.1 and User is the username of your account profile. Select all files that begin with iconcache. Right-click on these files. Click Delete.To delete these files faster, press the Shift + Delete keys.
You can just run the following command line:
c:\Windows\System32\ie4uinit.exe -ClearIconCache
That command line will delete your cache icons without need to restart explorer
SystemParametersInfo() has a parameter called SPI_SETICONS that "Reloads the system icons" according to MSDN. I have never tried to use SPI_SETICONS so I don't know if it works, if you wanted to test you would use something like
System::Call 'user32::SystemParametersInfo(i 0x0058,i0,i0,i2)i' ;SPI_SETICONS
If it turns out that this is not enough, you can bring out the big undocumented hammer:
Note that this could re-arrange the desktop icons even if "Auto Arrange" is off and possibly other things that might annoy the user!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With