[SHELL32] Don't pass menu band hwnd to InvokeCommand (#7945)

The menu band window is about to go away, don't pass it to InvokeCommand because it's invalid as an owner window for any dialogs the callee might display.
This commit is contained in:
Whindmar Saksit
2025-04-28 00:24:15 +02:00
committed by GitHub
parent 9b70d4380c
commit 378a335468

View File

@@ -861,7 +861,8 @@ HRESULT CMenuBand::_TrackContextMenu(IContextMenu * contextMenu, INT x, INT y)
_MenuItemSelect(MPOS_FULLCANCEL);
TRACE("Before InvokeCommand\n");
CMINVOKECOMMANDINFO cmi = { sizeof(cmi), 0, hwnd };
// Note: Not passing hwnd to InvokeCommand because it can be a BaseBar window that is about to die
CMINVOKECOMMANDINFO cmi = { sizeof(cmi), 0, NULL };
cmi.lpVerb = MAKEINTRESOURCEA(uCommand - idCmdFirst);
if (GetKeyState(VK_SHIFT) < 0)
cmi.fMask |= CMIC_MASK_SHIFT_DOWN;