/// <summary> /// Initializes a new instance of the <see cref="GestureListener"/> class to receive specific gestures. /// </summary> /// <param name="parent">The parent.</param> /// <param name="configs">The gesture configurations.</param> public GestureListener( Control parent, GestureConfig[] configs ) { if ( parent.IsHandleCreated ) { Initialize( parent ); } else { parent.HandleCreated += OnHandleCreated; } parent.HandleDestroyed += OnHandleDestroyed; m_configs = configs; }
/// <summary> /// Registers the HWND to receive specific gestures. /// </summary> /// <remarks> /// http://msdn.microsoft.com/en-us/library/windows/desktop/dd353231%28v=vs.85%29.aspx /// </remarks> /// <param name="hwnd">The HWND.</param> /// <param name="configs">The gesture configurations</param> /// <returns></returns> public static bool SetGestureConfig( IntPtr hwnd, GestureConfig[] configs ) { return _pSetGestureConfig( hwnd, 0, 1, configs, (uint)Marshal.SizeOf( typeof( GestureConfig ) ) ); }