Commit f9b4f6ae authored by Juha Manninen's avatar Juha Manninen
Browse files

LCL-Win32: Call OnClick of a parent menuitem from submenu of a popupmenu....

LCL-Win32: Call OnClick of a parent menuitem from submenu of a popupmenu. Issue #35219, patch from Benito van der Zander.

git-svn-id: trunk@60679 -
parent ab1727e0
......@@ -401,14 +401,18 @@ end;
function TWindowProcHelper.GetPopMenuItemObject: TObject;
var
MainMenuHandle: HMENU;
MenuHandle: HMENU;
MenuInfo: MENUITEMINFO;
begin
MenuInfo.cbSize := MMenuItemInfoSize;
MenuInfo.fMask := MIIM_DATA;
MainMenuHandle := GetMenuParent(HMENU(WParam), GetMenu(Window));
if GetMenuItemInfo(MainMenuHandle, LOWORD(LParam), true, @MenuInfo) then
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
Result := TObject(MenuInfo.dwItemData)
else
Result := nil;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment