Forcing windows explorer icons to update?

1,792 views
Skip to first unread message

Mark Larson (Google)

unread,
Apr 6, 2011, 8:38:49 PM4/6/11
to chromium-dev
http://crbug.com/78398

If you get updated to a new version of Google Chrome with the new icons, your taskbar and/or shortcut icons might not get updated because the old icons are still the iconcache.

I'm betting there's a shell function that can be called to force explorer to update the icon and that someone on this list knows what it is.

--Mark

Nico Weber

unread,
Apr 6, 2011, 8:42:42 PM4/6/11
to m...@chromium.org, chromium-dev
Something like this:

SHFILEINFO info;
SHGetFileInfo(data.appName.c_str(), 0, &info, sizeof(info), SHGFI_ICON);
DestroyIcon(info.hIcon);
SHChangeNotify(SHCNE_UPDATEIMAGE, SHCNF_DWORD, &info.iIcon, NULL);

Nico

> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>

Peter Kasting

unread,
Apr 6, 2011, 8:44:12 PM4/6/11
to m...@chromium.org, chromium-dev
On Wed, Apr 6, 2011 at 5:38 PM, Mark Larson (Google) <m...@chromium.org> wrote:
http://crbug.com/78398

If you get updated to a new version of Google Chrome with the new icons, your taskbar and/or shortcut icons might not get updated because the old icons are still the iconcache.

The explorer icon cache is supposed to be cleared on reboot, though, while that bug sees problems across reboots.

According to http://www.vistax64.com/tutorials/117229-icon-cache-rebuild.html , you can clear the cache on Vista via:

taskkill /IM explorer.exe /F
CD /d %userprofile%\AppData\Local
DEL IconCache.db /a
shutdown /r

Other articles say it's similar on XP, you just have to adjust the profile directory.

TweakUI also has a method to rebuild the icon cache, you could try spying on it and seeing what it does.

PK

Sailesh Agrawal

unread,
Apr 6, 2011, 10:03:09 PM4/6/11
to tha...@chromium.org, m...@chromium.org, chromium-dev
Hm... SHChangeNotify doesn't work for me. Explorer keeps displaying the wrong icon.

Xiyuan Xia

unread,
Apr 7, 2011, 1:24:59 PM4/7/11
to sa...@chromium.org, tha...@chromium.org, m...@chromium.org, chromium-dev
I used the following SHChangeNotify call to force explorer icon cache refresh.

      SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST | SHCNF_FLUSHNOWAIT,
                     NULL, NULL);

But as Perter said before, if the problem persists between reboots, SHChangeNotify probably won't help.
Reply all
Reply to author
Forward
0 new messages