* Fix icon leak of the returned old icon from WM_SETICON.
[RSHELL]
* Add two debug prints (not hit).
[FILEBROWSER]
[EXPLORER-NEW]
* Free PWSTR pointers after exiting.
svn path=/branches/shell-experiments/; revision=64940
if (GetShellWindow() == NULL)
CreateShellDesktop = TRUE;
- /* FIXME - initialize SSO Thread */
-
if (!CreateShellDesktop)
{
EXPLORER_CMDLINE_PARSE_RESULTS parseResults = { 0 };
if (SHExplorerParseCmdLine(&parseResults))
return SHCreateFromDesktop(&parseResults);
+
+ if (parseResults.strPath)
+ SHFree(parseResults.strPath);
+
+ if (parseResults.pidlPath)
+ ILFree(parseResults.pidlPath);
+
+ if (parseResults.pidlRoot)
+ ILFree(parseResults.pidlRoot);
+
}
if (RegOpenKey(HKEY_CURRENT_USER,
return SHCreateFromDesktop(&parseResults);
}
+ if (parseResults.strPath)
+ SHFree(parseResults.strPath);
+
+ if (parseResults.pidlPath)
+ ILFree(parseResults.pidlPath);
+
+ if (parseResults.pidlRoot)
+ ILFree(parseResults.pidlRoot);
+
return 0;
}
HRESULT CMenuFocusManager::PlaceHooks()
{
+ if (m_hMsgFilterHook)
+ {
+ WARN("GETMESSAGE hook already placed!\n");
+ return S_OK;
+ }
+ if (m_hMsgFilterHook)
+ {
+ WARN("MSGFILTER hook already placed!\n");
+ return S_OK;
+ }
if (m_current->type == TrackedMenuEntry)
{
TRACE("Entering MSGFILTER hook...\n");
HICON icSmall = ImageList_GetIcon(himlSmall, indexOpen, 0);
HICON icLarge = ImageList_GetIcon(himlLarge, indexOpen, 0);
- SendMessage(WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(icSmall));
- SendMessage(WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(icLarge));
+ HICON oldSmall = (HICON)SendMessage(WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(icSmall));
+ HICON oldLarge = (HICON)SendMessage(WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(icLarge));
+
+ DestroyIcon(oldSmall);
+ DestroyIcon(oldLarge);
}
// TODO: Update the window icon