mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 17:02:11 +02:00
fix menu items not firing in win95 and NT (issue #7655, patch from msmat)
git-svn-id: trunk@10227 -
This commit is contained in:
parent
ecd3879ac4
commit
eb03426f43
@ -257,13 +257,21 @@ Var
|
||||
end;
|
||||
|
||||
function GetMenuItemObject: TObject;
|
||||
var MenuInfo: MENUITEMINFO;
|
||||
MainMenuHandle: HMENU;
|
||||
PopupMenu: TPopupMenu;
|
||||
var
|
||||
MenuInfo: MENUITEMINFO;
|
||||
MainMenuHandle: HMENU;
|
||||
PopupMenu: TPopupMenu;
|
||||
MenuItemInfoSize: DWORD;
|
||||
const
|
||||
W95_MENUITEMINFO_SIZE = 44;
|
||||
begin
|
||||
Result:=nil;
|
||||
MenuInfo.cbSize:=sizeof(MENUITEMINFO);
|
||||
MenuInfo.fMask:=MIIM_DATA;
|
||||
if (Win32MajorVersion = 4) and (Win32MinorVersion = 0) then
|
||||
MenuItemInfoSize := W95_MENUITEMINFO_SIZE
|
||||
else
|
||||
MenuItemInfoSize := sizeof(MENUITEMINFO);
|
||||
Result := nil;
|
||||
MenuInfo.cbSize := MenuItemInfoSize;
|
||||
MenuInfo.fMask := MIIM_DATA;
|
||||
{first we have to decide if the command is from a popup menu or from the window main menu}
|
||||
//if the 'PopupMenu' property exists, there is a big probability that the command is from a popup menu
|
||||
PopupMenu := WindowInfo^.PopupMenu;
|
||||
|
Loading…
Reference in New Issue
Block a user