Personally I cannot see any reason to use this API function, as any info you could receive from it could also be retrieved by looking directly at the menu item via Delphi.
you must specify the cbSize item in the TMenuItemInfoA-record
before windows can handle it properly, like this
procedure TForm1.Button2Click(Sender: TObject);
var mm : TmenuItemInfoa;
h : Hmenu;
begin
mm.cbSize:=sizeof(TMenuItemInfo);
if GetMenuItemInfo(MainMenu1.Handle,
1,
true,
MM) then showmessage ('ok')
else showmessage('no');
end;
i think that 0=first top item, 1=second top item and so on.