[EXPLORER] Fix Start Menu context menu actions (#4643)

CORE-18336

The current design was not processing actions verbs correctly for some
Start Menu context menu actions (Properties, Open all users, Explore all users),
despite associated code being implemented.
This was due by incorrectly filtering command IDs, not routing to the appropriate processing.
This commit is contained in:
Kyle Katarn 2022-09-09 20:23:11 +02:00 committed by GitHub
parent 5bd03d8b97
commit a1f6d8a3f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,7 @@ class CStartMenuBtnCtxMenu :
CComPtr<ITrayWindow> m_TrayWnd;
CComPtr<IContextMenu> m_Inner;
CComPtr<IShellFolder> m_Folder;
UINT m_idCmdCmLast;
HWND m_Owner;
LPITEMIDLIST m_FolderPidl;
@ -167,7 +168,8 @@ public:
hRet = psfDesktop->BindToObject(pidlStart, NULL, IID_PPV_ARG(IShellFolder, &m_Folder));
if (SUCCEEDED(hRet))
{
CreateContextMenuFromShellFolderPidl(hPopup);
hRet = CreateContextMenuFromShellFolderPidl(hPopup);
m_idCmdCmLast = (SUCCEEDED(hRet)) ? HRESULT_CODE(hRet) : ID_SHELL_CMD_LAST;
AddStartContextMenuItems(hPopup);
}
}
@ -185,7 +187,7 @@ public:
UINT uiCmdId = PtrToUlong(lpici->lpVerb);
if (uiCmdId != 0)
{
if ((uiCmdId >= ID_SHELL_CMD_FIRST) && (uiCmdId <= ID_SHELL_CMD_LAST))
if ((uiCmdId >= ID_SHELL_CMD_FIRST) && (uiCmdId < m_idCmdCmLast))
{
CMINVOKECOMMANDINFO cmici = { 0 };
CHAR szDir[MAX_PATH];
@ -224,6 +226,7 @@ public:
CStartMenuBtnCtxMenu()
{
m_idCmdCmLast = ID_SHELL_CMD_LAST;
}
virtual ~CStartMenuBtnCtxMenu()