mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 10:10:31 +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;
|
end;
|
||||||
|
|
||||||
function GetMenuItemObject: TObject;
|
function GetMenuItemObject: TObject;
|
||||||
var MenuInfo: MENUITEMINFO;
|
var
|
||||||
|
MenuInfo: MENUITEMINFO;
|
||||||
MainMenuHandle: HMENU;
|
MainMenuHandle: HMENU;
|
||||||
PopupMenu: TPopupMenu;
|
PopupMenu: TPopupMenu;
|
||||||
|
MenuItemInfoSize: DWORD;
|
||||||
|
const
|
||||||
|
W95_MENUITEMINFO_SIZE = 44;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
if (Win32MajorVersion = 4) and (Win32MinorVersion = 0) then
|
||||||
MenuInfo.cbSize:=sizeof(MENUITEMINFO);
|
MenuItemInfoSize := W95_MENUITEMINFO_SIZE
|
||||||
MenuInfo.fMask:=MIIM_DATA;
|
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}
|
{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
|
//if the 'PopupMenu' property exists, there is a big probability that the command is from a popup menu
|
||||||
PopupMenu := WindowInfo^.PopupMenu;
|
PopupMenu := WindowInfo^.PopupMenu;
|
||||||
|
Loading…
Reference in New Issue
Block a user