Refresh shell icons: Difference between revisions
Jpderuiter (talk | contribs) m (→How To Use) |
|||
(One intermediate revision by one other user not shown) | |||
Line 2: | Line 2: | ||
== How To Use == | == How To Use == | ||
After changing file associations, you can call this macro to refresh the shell immediatly. It calls the shell32 function [http://msdn.microsoft.com | After changing file associations, you can call this macro to refresh the shell immediatly. It calls the shell32 function [http://msdn.microsoft.com/en-us/library/bb762118.aspx SHChangeNotify]. This will force windows to reload your changes from the registry. | ||
<highlight-nsis> | <highlight-nsis> | ||
Line 9: | Line 9: | ||
''Note:'' If you are creating a desktop shortcut to your application, using an ICO icon file inside your application folder, and you change the icon design some time later, Windows will not refresh the desktop shortcut on subsequent installation of your updated application - not even after a reboot. Using the "Refresh shell icons" trick (mentioned elsewhere) also does not work. I've found you have to rename the ICO file in the application folder (e.g. from "appicon.ico" to "appicon2.ico") to force a refresh. | ''Note:'' If you are creating a desktop shortcut to your application, using an ICO icon file inside your application folder, and you change the icon design some time later, Windows will not refresh the desktop shortcut on subsequent installation of your updated application - not even after a reboot. Using the "Refresh shell icons" trick (mentioned elsewhere) also does not work. I've found you have to rename the ICO file in the application folder (e.g. from "appicon.ico" to "appicon2.ico") to force a refresh. | ||
--[[User:84.9.61.137|84.9.61.137]] 06:11, 18 April 2006 (PDT) Steve S | |||
== The Function == | == The Function == |
Latest revision as of 21:09, 29 April 2009
Author: jerometremblay (talk, contrib) |
How To Use
After changing file associations, you can call this macro to refresh the shell immediatly. It calls the shell32 function SHChangeNotify. This will force windows to reload your changes from the registry.
Call RefreshShellIcons
Note: If you are creating a desktop shortcut to your application, using an ICO icon file inside your application folder, and you change the icon design some time later, Windows will not refresh the desktop shortcut on subsequent installation of your updated application - not even after a reboot. Using the "Refresh shell icons" trick (mentioned elsewhere) also does not work. I've found you have to rename the ICO file in the application folder (e.g. from "appicon.ico" to "appicon2.ico") to force a refresh. --84.9.61.137 06:11, 18 April 2006 (PDT) Steve S
The Function
!define SHCNE_ASSOCCHANGED 0x08000000 !define SHCNF_IDLIST 0 Function RefreshShellIcons ; By jerome tremblay - april 2003 System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \ (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)' FunctionEnd