InkEdit.Gesture event

Occurs when an application gesture is recognized.


HRESULT Gesture(
  [in]      IInkCursor   *Cursor,
  [in]      IInkStrokes  *Strokes,
  [in]      VARIANT      Gestures,
  [in, out] VARIANT_BOOL *Cancel


Cursor [in]

The IInkCursor object that was used to create this gesture.

Strokes [in]

The InkStrokes collection that contains the IInkStrokeDisp objects that make up this gesture.

Gestures [in]

An array of IInkGesture objects, in order of confidence.

For more information about the VARIANT structure, see Using the COM Library.

Cancel [in, out]

Whether the InkStrokes collection that makes up this gesture should be canceled, so as not to erase the ink and to fire the Stroke event.

Return value

If this event succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


This event method is defined in the _IInkEditEvents interface. The _IInkEditEvents interface implements the IDispatch interface with an identifier of DISPID_IeeGesture.

A Gesture event is raised only if the IInkStrokeDisp for the IInkGesture object is the first IInkStrokeDisp object since the last call to the Recognize method or the last firing of the recognition timeout.

If the Gesture event is canceled, the Stroke event is raised for the InkStrokes collection that raised the Gesture event.

For this event to occur, the InkEdit control must subscribe to a set of application gestures. To set the InkEdit control's interest in a set of gestures, call the SetGestureStatus method.

For a list of application gestures, see the InkApplicationGesture enumeration type.

The InkEdit control does not recognize multiple stroke gestures.

The InkEdit control subscribes to the following gestures.

Gesture Action
Down-left ,Down-left-long
Up-right, Up-right-long

To alter the default action for a gesture:

  1. Add event handlers for the Gesture and Stroke events.
  2. In the Gesture event handler, cancel the Gesture event for the gesture, and perform the alternate action for the gesture.
  3. In the Stroke event handler, cancel the Stroke event for the IInkStrokeDisp object that raised the canceled Gesture event.


Minimum supported client
Windows XP Tablet PC Edition [desktop apps only]
Minimum supported server
None supported
Inked.h (also requires inked_i.c)

See also


InkApplicationGesture Enumeration

SetGestureStatus Method [InkEdit Control]

RecoTimeout Property

Stroke Event [InkEdit Control]

Using Gestures