如何获取鼠标右键的消息???(10分)

  • 主题发起人 主题发起人 duying668
  • 开始时间 开始时间
D

duying668

Unregistered / Unconfirmed
GUEST, unregistred user!
如何获取鼠标右键的消息????
 
在MouseDown事件中获取吧,下面是左键的双击判断<br>if (Button = mbLeft) and (Shift=ssDouble) then
 
procedure TfrmMain.ApplicationEvents1Message(var Msg: tagMSG;<br>&nbsp; var Handled: Boolean);<br>begin<br>&nbsp;if IsChild(YOURCOMPONENT.Handle, Msg.Hwnd) and <br>//是否是你指定控件上<br>&nbsp; &nbsp; &nbsp;((Msg.Message = WM_RBUTTONDOWN) or (Msg.Message = WM_RBUTTONUP)) then<br>//右键消息<br>&nbsp; begin<br>&nbsp; &nbsp; //你的事件 <br>&nbsp; &nbsp; Handled:=True;<br>&nbsp; end;<br>end;
 
后退
顶部