LCL-Win32: Fix hints in mainmenu's submenus. Issue #33070, patch from Serge Anvarov.

git-svn-id: trunk@57147 -
This commit is contained in:
juha 2018-01-25 11:13:17 +00:00
parent 47ca6a4009
commit cfb33a15c7

View File

@ -438,6 +438,7 @@ function TWindowProcHelper.GetMenuItemObject(ByPosition: Boolean): TObject;
var
MenuInfo: MENUITEMINFO;
PopupMenu: TPopupMenu;
Menu: HMENU;
begin
// first we have to decide if the command is from a popup menu
// or from the window main menu
@ -456,7 +457,11 @@ begin
MenuInfo.cbSize := MMenuItemInfoSize;
MenuInfo.fMask := MIIM_DATA;
if GetMenuItemInfo(GetMenu(Window), LOWORD(Integer(WParam)), ByPosition, @MenuInfo) then
if ByPosition then
Menu := LParam
else
Menu := GetMenu(Window);
if GetMenuItemInfo(Menu, LOWORD(Integer(WParam)), ByPosition, @MenuInfo) then
Result := TObject(MenuInfo.dwItemData)
else
Result := nil;