https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5bd86b8487058b7a8d75c…
commit 5bd86b8487058b7a8d75c9dfcbbca861e20cff49
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Oct 16 00:51:19 2022 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Wed Oct 19 19:37:41 2022 +0200
[SHELL32] Fix menu item handling
This restores the 'properties' functionality on the desktop
Bug found by Hervé Poussineau
---
dll/win32/shell32/CDefaultContextMenu.cpp | 2 +-
dll/win32/shell32/folders/CDesktopFolder.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp
b/dll/win32/shell32/CDefaultContextMenu.cpp
index 10cffcfe4f2..15acfae51a3 100644
--- a/dll/win32/shell32/CDefaultContextMenu.cpp
+++ b/dll/win32/shell32/CDefaultContextMenu.cpp
@@ -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;
diff --git a/dll/win32/shell32/folders/CDesktopFolder.cpp
b/dll/win32/shell32/folders/CDesktopFolder.cpp
index 3e7c3b950e6..8aa1e089fff 100644
--- a/dll/win32/shell32/folders/CDesktopFolder.cpp
+++ b/dll/win32/shell32/folders/CDesktopFolder.cpp
@@ -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);
}
@@ -887,4 +887,4 @@ HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
TRACE("-- %p->(%p)\n",psf, *psf);
return hres;
-}
\ No newline at end of file
+}