X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=dll%2Fwin32%2Fbrowseui%2Fshellbrowser.cpp;h=c12143e143edf78ee3082ffc8afd41077e00a3e3;hp=ea89e17ea50fa8ad840df848f6b812595b9d11b5;hb=d07a1dc09a02f9693c5c324610cf28972b39bcf5;hpb=8069b8c90ddf941e9877bb4c68645443e4388b8a diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp index ea89e17ea50..c12143e143e 100644 --- a/dll/win32/browseui/shellbrowser.cpp +++ b/dll/win32/browseui/shellbrowser.cpp @@ -1078,15 +1078,18 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder, HICON icSmall = ImageList_GetIcon(himlSmall, indexOpen, 0); HICON icLarge = ImageList_GetIcon(himlLarge, indexOpen, 0); - HICON oldSmall = (HICON)SendMessage(WM_SETICON, ICON_SMALL, reinterpret_cast(icSmall)); - HICON oldLarge = (HICON)SendMessage(WM_SETICON, ICON_BIG, reinterpret_cast(icLarge)); + /* Hack to make it possible to release the old icons */ + /* Something seems to go wrong with WM_SETICON */ + HICON oldSmall = (HICON)SendMessage(WM_GETICON, ICON_SMALL, 0); + HICON oldLarge = (HICON)SendMessage(WM_GETICON, ICON_BIG, 0); + + SendMessage(WM_SETICON, ICON_SMALL, reinterpret_cast(icSmall)); + SendMessage(WM_SETICON, ICON_BIG, reinterpret_cast(icLarge)); DestroyIcon(oldSmall); DestroyIcon(oldLarge); } - // TODO: Update the window icon - FireCommandStateChangeAll(); hResult = UpdateForwardBackState(); return S_OK;