Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Kill then restart explorer.exe (http://forums.winamp.com/showthread.php?t=389707)

Mircea M 27th January 2016 15:22

Kill then restart explorer.exe
 
Hi,

due to a change in the icon of our application in the new version, I need to rebuild the Windows icon cache. Deleting the IconCache.db file works but in order to show the new icon to the user immediately, I need to restart the explorer.exe process. Again, killing it is no problem but when I want to restart it, instead of getting the start menu, desktop, etc. back, I only get a Windows Explorer window.

If I restart the process manually (Task Manager -> File -> new Task -> explorer.exe), the desktop, start menu and new icons are there.

Any idea how to achieve this through the installer?

Here's my code:

code:
Function IconCacheRebuild
ExecWait "taskkill /F /IM explorer.exe"
Delete "$LOCALAPPDATA\IconCache.db"
ExecWait "explorer.exe"
FunctionEnd



Thanks!

JasonFriday13 28th January 2016 09:33

Try this:

Quote:

!define SHCNE_ASSOCCHANGED 0x8000000
!define SHCNF_IDLIST 0

System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, p0, p0)'

Mircea M 28th January 2016 11:59

Jason, you're a life-saver! Thanks!


All times are GMT. The time now is 17:21.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.