[SHELL32][SHDOCVW] Only forward menu messages to the correct shell extension (#7968)

Folder Marker 1.4 fails if it gets a WM_INITPOPUPMENU it does not expect.

CORE-17811
This commit is contained in:
Whindmar Saksit 2025-05-15 12:21:22 +02:00 committed by GitHub
parent 6bfb792439
commit 53685ada35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 77 additions and 81 deletions

View file

@ -704,7 +704,7 @@ HRESULT
WINAPI
CNewMenu::HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return S_OK;
return HandleMenuMsg2(uMsg, wParam, lParam, NULL);
}
HRESULT
@ -734,19 +734,19 @@ CNewMenu::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plRes
if (!lpdis || lpdis->CtlType != ODT_MENU)
break;
DWORD id = LOWORD(lpdis->itemID);
DWORD id = lpdis->itemID;
HICON hIcon = NULL;
if (m_idCmdFirst + id == m_idCmdFolder)
if (id == m_idCmdFolder)
{
hIcon = m_hIconFolder;
}
else if (m_idCmdFirst + id == m_idCmdLink)
else if (id == m_idCmdLink)
{
hIcon = m_hIconLink;
}
else
{
SHELLNEW_ITEM *pItem = FindItemFromIdOffset(id);
SHELLNEW_ITEM *pItem = FindItemFromIdOffset(id - m_idCmdFirst);
if (pItem)
hIcon = pItem->hIcon;
}