Revert r60679 #f9b4f6ae8d, LCL-Win32 calling OnClick of a parent menuitem. Issue #37210.

git-svn-id: trunk@63518 -
This commit is contained in:
juha 2020-07-06 09:02:06 +00:00
parent 0a2fde2d2c
commit c8da630845

View File

@ -441,18 +441,14 @@ end;
function TWindowProcHelper.GetPopMenuItemObject: TObject;
var
MenuHandle: HMENU;
MainMenuHandle: HMENU;
MenuInfo: MENUITEMINFO;
begin
MenuInfo.cbSize := MMenuItemInfoSize;
MenuInfo.fMask := MIIM_DATA;
MenuHandle := 0;
if Assigned(WindowInfo^.PopupMenu) then
MenuHandle := GetMenuParent(HMENU(WParam), WindowInfo^.PopupMenu.Handle);
if MenuHandle = 0 then
MenuHandle := GetMenuParent(HMENU(WParam), GetMenu(Window));
if GetMenuItemInfo(MenuHandle, LOWORD(LParam), true, @MenuInfo) then
MainMenuHandle := GetMenuParent(HMENU(WParam), GetMenu(Window));
if GetMenuItemInfo(MainMenuHandle, LOWORD(LParam), true, @MenuInfo) then
Result := TObject(MenuInfo.dwItemData)
else
Result := nil;