B
B McMurray
Hi,
Ive been trying to p/invoke this function but always get
a System.NotSupportedException exception (yeah that old
chestnut). Can anyone spot what im doing wrong? :
[DllImport("coredll.dll", SetLastError=true)] private
static extern uint SHRecognizeGesture(SHRGINFO shrg);
....
[StructLayout(LayoutKind.Sequential)] private struct
SHRGINFO
{
public uint cbSize;
public IntPtr hwndClient;
public UInt16 ptX;
public UInt16 ptY;
public uint dwFlags;
}
....
SHRGINFO shrg = new SHRGINFO();
shrg.cbSize = (uint)Marshal.SizeOf(shrg.GetType
());
shrg.ptX = (UInt16)e.X;
shrg.ptY = (UInt16)e.Y;
shrg.dwFlags = SHRG_RETURNCMD;
this.Capture = true;
shrg.hwndClient = GetCapture();
this.Capture = false;
x = SHRecognizeGesture(shrg);
rgds
Bob
Ive been trying to p/invoke this function but always get
a System.NotSupportedException exception (yeah that old
chestnut). Can anyone spot what im doing wrong? :
[DllImport("coredll.dll", SetLastError=true)] private
static extern uint SHRecognizeGesture(SHRGINFO shrg);
....
[StructLayout(LayoutKind.Sequential)] private struct
SHRGINFO
{
public uint cbSize;
public IntPtr hwndClient;
public UInt16 ptX;
public UInt16 ptY;
public uint dwFlags;
}
....
SHRGINFO shrg = new SHRGINFO();
shrg.cbSize = (uint)Marshal.SizeOf(shrg.GetType
());
shrg.ptX = (UInt16)e.X;
shrg.ptY = (UInt16)e.Y;
shrg.dwFlags = SHRG_RETURNCMD;
this.Capture = true;
shrg.hwndClient = GetCapture();
this.Capture = false;
x = SHRecognizeGesture(shrg);
rgds
Bob