mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-11 08:40:41 +01:00
* fixed Win64 in behalf of Micha
git-svn-id: trunk@10119 -
This commit is contained in:
parent
0be210dffc
commit
107c5e7c0b
@ -103,6 +103,9 @@ const
|
||||
// Since W98 the size is 48 (hbmpItem was added)
|
||||
W95_MENUITEMINFO_SIZE = 44;
|
||||
|
||||
var
|
||||
menuiteminfosize : DWORD = 0;
|
||||
|
||||
type
|
||||
TCaptionFlags = (cfBold, cfUnderline);
|
||||
TCaptionFlagsSet = set of TCaptionFlags;
|
||||
@ -139,7 +142,7 @@ var MenuItemIndex: integer;
|
||||
begin
|
||||
Result := MakeLResult(0, 0);
|
||||
MenuItemIndex := -1;
|
||||
ItemInfo.cbSize := W95_MENUITEMINFO_SIZE;
|
||||
ItemInfo.cbSize := menuiteminfosize;
|
||||
ItemInfo.fMask := MIIM_DATA;
|
||||
if not GetMenuItemInfo(AMenuHandle, 0, true, @ItemInfo) then Exit;
|
||||
FirstMenuItem := TMenuItem(ItemInfo.dwItemData);
|
||||
@ -445,7 +448,7 @@ function ChangeMenuFlag(const AMenuItem: TMenuItem; Flag: Integer; Value: boolea
|
||||
var
|
||||
MenuInfo: MENUITEMINFO;
|
||||
begin
|
||||
MenuInfo.cbSize := W95_MENUITEMINFO_SIZE;
|
||||
MenuInfo.cbSize := menuiteminfosize;
|
||||
MenuInfo.fMask := MIIM_TYPE;
|
||||
MenuInfo.dwTypeData := nil; // don't retrieve caption
|
||||
GetMenuItemInfo(AMenuItem.Parent.Handle, AMenuItem.Command, false, @MenuInfo);
|
||||
@ -466,7 +469,7 @@ var
|
||||
begin
|
||||
with MenuInfo do
|
||||
begin
|
||||
cbsize := W95_MENUITEMINFO_SIZE;
|
||||
cbsize := menuiteminfosize;
|
||||
if ACaption <> '-' then
|
||||
begin
|
||||
fType := MFT_STRING;
|
||||
@ -479,7 +482,7 @@ begin
|
||||
SetMenuItemInfo(AMenuItem.Parent.Handle, AMenuItem.Command, false, @MenuInfo);
|
||||
with MenuInfo do
|
||||
begin
|
||||
cbsize := W95_MENUITEMINFO_SIZE;
|
||||
cbsize := menuiteminfosize;
|
||||
fMask := MIIM_TYPE;
|
||||
fType := MFT_OWNERDRAW;
|
||||
dwTypeData:=LPSTR(ACaption);
|
||||
@ -503,7 +506,7 @@ begin
|
||||
begin
|
||||
ParentOfParent := AMenuItem.Parent.Parent.Handle;
|
||||
with MenuInfo do begin
|
||||
cbSize := W95_MENUITEMINFO_SIZE;
|
||||
cbSize := menuiteminfosize;
|
||||
fMask:=MIIM_SUBMENU;
|
||||
end;
|
||||
GetMenuItemInfo(ParentOfParent, AMenuItem.Parent.Command,
|
||||
@ -517,7 +520,7 @@ begin
|
||||
end;
|
||||
|
||||
with MenuInfo do begin
|
||||
cbsize := W95_MENUITEMINFO_SIZE;
|
||||
cbsize := menuiteminfosize;
|
||||
if AMenuItem.Enabled then fState:=MFS_ENABLED else fstate:=MFS_GRAYED;
|
||||
if AMenuItem.Checked then fState:=fState or MFS_CHECKED;
|
||||
fMask:=MIIM_ID or MIIM_DATA or MIIM_STATE or MIIM_TYPE;
|
||||
@ -614,6 +617,10 @@ begin
|
||||
end;
|
||||
|
||||
initialization
|
||||
if (Win32MajorVersion=4) and (Win32MinorVersion=0) then
|
||||
menuiteminfosize:=W95_MENUITEMINFO_SIZE
|
||||
else
|
||||
menuiteminfosize:=sizeof(TMenuItemInfo);
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
// I M P O R T A N T
|
||||
|
||||
Loading…
Reference in New Issue
Block a user