I was able to implement this by inheriting from the button and redefining WndProc as ho1 and Reed. Here's the inherited button:
public class RButton : Button { public delegate void MouseDoubleRightClick(object sender, MouseEventArgs e); public event MouseDoubleRightClick DoubleRightClick; protected override void WndProc(ref Message m) { const Int32 WM_RBUTTONDBLCLK = 0x0206; if (m.Msg == WM_RBUTTONDBLCLK) DoubleRightClick(this, null); base.WndProc(ref m); } }
I added the program to the form and subscribed to its new DoubleRightClick event. I'm not sure how to create the appropriate MouseEventArgs , but since this is just a test case, it doesnβt matter.
Jyelton
source share