instead of double clic, what about right clic ?
so here is how to detect when the user clic with it's right hand (hahaha ;-)
public const uint GN_CONTEXTMENU = 1000;
public const uint SHRG_RETURNCMD = 0x00000001;
[StructLayout(LayoutKind.Sequential)]
public class SHRGINFO
{
public uint cbSize = 0;
public IntPtr hwndClient = IntPtr.Zero;
public int x = 0; // POINT
public int y = 0; // POINT
public uint dwFlags = 0;
}
[DllImport("aygshell", SetLastError=true)]
public static extern uint SHRecognizeGesture(SHRGINFO shrg);
public bool IsContextMenu(MouseEventArgs e)
{
if(e.Button != MouseButtons.Left) // ?? just to be sure
return false;
WinAPI.SHRGINFO shrginfo = new WinAPI.SHRGINFO();
shrginfo.cbSize = (uint) Marshal.SizeOf(shrginfo);
shrginfo.hwndClient = Handle;
shrginfo.x = e.X;
shrginfo.y = e.Y;
shrginfo.dwFlags = WinAPI.SHRG_RETURNCMD;
if (WinAPI.SHRecognizeGesture(shrginfo) == WinAPI.GN_CONTEXTMENU)
return true;
return false;
}
Why doesn't the .net cf Control class have a DoubleClick Event? The regular XP/.NET framework classes for System.Windows.Forms
has an event handler:
public event System.EventHandler DoubleClick
Member of System.Windows.Forms.Control
How do you handle double-clicks on a Pocket-PC environment with .net CF?