If the record is not packed in winuser.h, then it is wrong to do this in FPC.
This works in both Win32 and Win64:
type
TMenuBarInfo = record
cbSize: DWORD;
rcBar: Windows.TRect; // rect of bar, popup, item
hmenu: HMENU; // real menu handle of bar, popup
hwndMenu: HWND; // hwnd of item submenu if one
// fBarFocused:1:BOOL; // bar, popup has the focus
// fFocused:1:BOOL; // item has the focus
FocusedBits: DWORD;
end;
By the way, Win32 really changes only the two least significant bits. Win64 overwrites the whole FocusedBits.