Y ysai Unregistered / Unconfirmed GUEST, unregistred user! 2004-03-26 #3 PMenuItemInfo = ^TMenuItemInfo;<br> TMenuItemInfo = record<br> Caption : String;<br> SubMenu : Boolean;<br> Index : Integer;<br> Command : Integer;<br> end;<br><br>function GetSubMenuItemInfo(<br> const AHwnd : Hwnd;//父菜单项的句柄<br> const Position : Integer//子菜单项的位置<br> )MenuItemInfo;<br>//取得菜单信息<br>var<br> psCaption : array[0..MAXBYTE] of char;<br> mf : tagMENUITEMINFO;<br>begin<br> New(Result);<br> GetMenuString(AHwnd,Position,psCaption,MAXBYTE,MF_BYPOSITION);<br> GetMenuItemInfo(AHwnd,Position,True,mf);<br> with Result^ do<br> begin<br> Command := GetMenuItemID(AHwnd,Position);<br> Index := Position;<br> Caption := psCaption;<br> end;<br>end;
PMenuItemInfo = ^TMenuItemInfo;<br> TMenuItemInfo = record<br> Caption : String;<br> SubMenu : Boolean;<br> Index : Integer;<br> Command : Integer;<br> end;<br><br>function GetSubMenuItemInfo(<br> const AHwnd : Hwnd;//父菜单项的句柄<br> const Position : Integer//子菜单项的位置<br> )MenuItemInfo;<br>//取得菜单信息<br>var<br> psCaption : array[0..MAXBYTE] of char;<br> mf : tagMENUITEMINFO;<br>begin<br> New(Result);<br> GetMenuString(AHwnd,Position,psCaption,MAXBYTE,MF_BYPOSITION);<br> GetMenuItemInfo(AHwnd,Position,True,mf);<br> with Result^ do<br> begin<br> Command := GetMenuItemID(AHwnd,Position);<br> Index := Position;<br> Caption := psCaption;<br> end;<br>end;