简单问题spy++如何取得菜单的commandid(30分)

  • 主题发起人 主题发起人 xpmai1
  • 开始时间 开始时间
X

xpmai1

Unregistered / Unconfirmed
GUEST, unregistred user!
如题,马上给分
 
&nbsp;PMenuItemInfo = ^TMenuItemInfo;<br>&nbsp; TMenuItemInfo = record<br>&nbsp; &nbsp; Caption &nbsp; &nbsp; : String;<br>&nbsp; &nbsp; SubMenu &nbsp; &nbsp; : Boolean;<br>&nbsp; &nbsp; Index &nbsp; &nbsp; &nbsp; : Integer;<br>&nbsp; &nbsp; Command &nbsp; &nbsp; : Integer;<br>&nbsp; end;<br><br>function GetSubMenuItemInfo(<br>&nbsp; const AHwnd &nbsp; &nbsp; : Hwnd;//父菜单项的句柄<br>&nbsp; const Position &nbsp;: Integer//子菜单项的位置<br>&nbsp; ):PMenuItemInfo;<br>//取得菜单信息<br>var<br>&nbsp; psCaption : array[0..MAXBYTE] of char;<br>&nbsp; mf &nbsp; &nbsp; &nbsp; &nbsp;: tagMENUITEMINFO;<br>begin<br>&nbsp; New(Result);<br>&nbsp; GetMenuString(AHwnd,Position,psCaption,MAXBYTE,MF_BYPOSITION);<br>&nbsp; GetMenuItemInfo(AHwnd,Position,True,mf);<br>&nbsp; with Result^ do<br>&nbsp; begin<br>&nbsp; &nbsp; Command := &nbsp;GetMenuItemID(AHwnd,Position);<br>&nbsp; &nbsp; Index &nbsp; := &nbsp;Position;<br>&nbsp; &nbsp; Caption := &nbsp;psCaption;<br>&nbsp; end;<br>end;
 
后退
顶部