[DllImport("aygshell.dll")]
static extern uint SHRecognizeGesture(ref SHRGINFO shrg);
Declare Function SHRecognizeGesture Lib "aygshell.dll" (shrg As SHRGINFO) As Integer
[StructLayout(LayoutKind.Sequential)]
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;
}
const uint GN_CONTEXTMENU = 1000;
const uint SHRG_RETURNCMD = 0x00000001;
const uint SHRG_NOTIFYPARENT = 0x00000002;
const uint SHRG_LONGDELAY = 0x00000008;
const uint SHRG_NOANIMATION = 0x00000010;
None
Please add some!
Use this in conjunction with the SetCapture/GetCapture HWND sample:
static bool RecognizeGesture(IntPtr hWnd, int x, int y)
{
SHRGINFO shrginfo = new SHRGINFO();
shrginfo.cbSize = (uint)Marshal.SizeOf(shrginfo);
shrginfo.hwndClient = hWnd;
shrginfo.x = x;
shrginfo.y = y;
shrginfo.dwFlags = SHRG_RETURNCMD;
return SHRecognizeGesture(ref shrginfo) == GN_CONTEXTMENU;
}
TODO