mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-21 23:19:48 +02:00
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 -
This commit is contained in:
parent
ab1727e00b
commit
f9b4f6ae8d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user