Skip to content

Instantly share code, notes, and snippets.

@harujoh
Created December 23, 2016 10:14
Show Gist options
  • Save harujoh/afcc60cae265dad30488cd0f093affd8 to your computer and use it in GitHub Desktop.
Save harujoh/afcc60cae265dad30488cd0f093affd8 to your computer and use it in GitHub Desktop.
[DllImport("user32")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetGestureConfig(IntPtr hWnd, int dwReserved, int cIDs, ref Gestureconfig pGestureConfig, int cbSize);
[StructLayout(LayoutKind.Sequential)]
private struct Gestureconfig
{
public int dwID;
public int dwWant;
public int dwBlock;
}
private const int GC_ALLGESTURES = 0x00000001;
readonly Gestureconfig _gc = new Gestureconfig
{
dwID = 0,
dwWant = 0, //必要であればこちらにGC_ALLGESTURES
dwBlock = GC_ALLGESTURES //必要であればこちらに0
};
public Form1()
{
InitializeComponent();
SetGestureConfig(
this.Handle,
0,
1,
ref this._gc,
Marshal.SizeOf(new Gestureconfig())
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment