[0.4.14][SHELL32] Bypass OpenWith for Delete and F2 (Rename) Keys (#4032) CORE-17810

Logspam started during 0.4.9-dev'ing when zipfldr got committed,
logspam became much worse by 0.4.10-dev-599-g 932df37
But the actual bug of 'calling those functions when not needed' is much older than that.

Fix picked from 0.4.15-dev-3275-g cee171f5d2
This commit is contained in:
Joachim Henze 2021-10-17 01:03:35 +02:00
parent 7e979e4c97
commit 84b077cca2

View file

@ -1570,19 +1570,21 @@ cleanup:
LRESULT CDefView::OnExplorerCommand(UINT uCommand, BOOL bUseSelection)
{
HRESULT hResult;
HMENU hMenu;
hMenu = CreatePopupMenu();
if (!hMenu)
return 0;
HMENU hMenu = NULL;
hResult = GetItemObject( bUseSelection ? SVGIO_SELECTION : SVGIO_BACKGROUND, IID_PPV_ARG(IContextMenu, &m_pCM));
if (FAILED_UNEXPECTEDLY( hResult))
goto cleanup;
if ((uCommand != FCIDM_SHVIEW_DELETE) && (uCommand != FCIDM_SHVIEW_RENAME))
{
hMenu = CreatePopupMenu();
if (!hMenu)
return 0;
hResult = m_pCM->QueryContextMenu(hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
if (FAILED_UNEXPECTEDLY( hResult))
goto cleanup;
hResult = m_pCM->QueryContextMenu(hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
if (FAILED_UNEXPECTEDLY(hResult))
goto cleanup;
}
InvokeContextMenuCommand(uCommand);