Author: gadamopoulos
Date: Tue Nov 29 17:56:04 2016
New Revision: 73407
URL:
http://svn.reactos.org/svn/reactos?rev=73407&view=rev
Log:
[SHELL32] - CDefViewBckgrndMenu: Shell_MergeMenus doesn't handle items added by shell
extensions correctly so let the folder IContextMenu add its items directly in the menu.
CORE-12508
Modified:
trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp
Modified: trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView…
==============================================================================
--- trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp [iso-8859-1] Tue Nov 29
17:56:04 2016
@@ -170,16 +170,25 @@
hr = m_psf->CreateViewObject(NULL, IID_PPV_ARG(IContextMenu,
&m_folderCM));
if (SUCCEEDED(hr))
{
- hr = m_folderCM->QueryContextMenu(hMenuPart, 0, idCmdFirst, idCmdLast,
uFlags);
+ InsertMenuA(hMenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
+ UINT SeparatorIndex = indexMenu;
+ UINT count = GetMenuItemCount(hMenu);
+
+ hr = m_folderCM->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast,
uFlags);
if (SUCCEEDED(hr))
{
- Shell_MergeMenus(hMenu, hMenuPart, indexMenu, 0, 0xFFFF,
MM_DONTREMOVESEPS | MM_SUBMENUSHAVEIDS);
- DestroyMenu(hMenuPart);
+ //Shell_MergeMenus(hMenu, hMenuPart, indexMenu, 0, UINT_MAX,
MM_ADDSEPARATOR| MM_DONTREMOVESEPS | MM_SUBMENUSHAVEIDS);
+ //DestroyMenu(hMenuPart);
}
else
{
WARN("QueryContextMenu failed!\n");
}
+
+ /* If no item was added after the separator, remove it */
+ if (count == GetMenuItemCount(hMenu))
+ DeleteMenu(hMenu, SeparatorIndex, MF_BYPOSITION);
+
}
else
{