[SHELL32] Fix menu item handling

This restores the 'properties' functionality on the desktop
Bug found by Hervé Poussineau
This commit is contained in:
Mark Jansen 2022-10-16 00:51:19 +02:00
parent 7b33915adc
commit 5bd86b8487
No known key found for this signature in database
GPG Key ID: B39240EE84BEAE8B
2 changed files with 3 additions and 3 deletions

View File

@ -646,7 +646,7 @@ CDefaultContextMenu::QueryContextMenu(
QCMINFO qcminfo = {hMenu, IndexMenu, idCmdNext, idCmdLast, NULL};
if (SUCCEEDED(_DoCallback(DFM_MERGECONTEXTMENU, uFlags, &qcminfo)))
{
UINT added = idCmdNext - (idCmdFirst + cIds);
UINT added = qcminfo.idCmdFirst - idCmdNext;
cIds += added;
IndexMenu += added;
m_iIdCBFirst = m_iIdSHELast;

View File

@ -860,7 +860,7 @@ HRESULT WINAPI CDesktopFolder::CallBack(IShellFolder *psf, HWND hwndOwner, IData
QCMINFO *pqcminfo = (QCMINFO *)lParam;
HMENU hpopup = CreatePopupMenu();
_InsertMenuItemW(hpopup, 0, TRUE, 0, MFT_STRING, MAKEINTRESOURCEW(IDS_PROPERTIES), MFS_ENABLED);
Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu++, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu, pqcminfo->idCmdFirst++, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
DestroyMenu(hpopup);
}