InkOverlay.Stroke event

Occurs when the user draws a new stroke on any tablet.


void Stroke(
  [in]      IInkCursor     *Cursor,
  [in]      IInkStrokeDisp *Stroke,
  [in, out] VARIANT_BOOL   *Cancel


Cursor [in]

The IInkCursor object that generated the Stroke event.

Stroke [in]

The collected IInkStrokeDisp object.

Cancel [in, out]

Specifies whether the event should be canceled. If TRUE, the collection of the stroke is canceled.

Return value

This event does not return a value.


This event method is defined in the _IInkCollectorEvents, _IInkOverlayEvents, and _IInkPictureEvents dispatch-only interfaces (dispinterfaces) with an ID of DISPID_ICEStroke.

The Stroke event is fired when in select or erase mode, not just when inserting ink. This requires that you monitor the editing mode (which you are responsible for setting) and are aware of the mode before interpreting the event. The advantage of this requirement is greater freedom to innovate on the platform through greater awareness of platform events.

Note  The Stroke event fires when the user finishes drawing a stroke, not when a stroke is added to the InkStrokes collection. When the user first starts to draw a stroke, it is added immediately to the InkStrokes collection; however, the Stroke event does not fire until the stroke is complete. Therefore, strokes can exist in the InkStrokes collection that the Stroke event handler has not seen.


Minimum supported client

Windows XP Tablet PC Edition [desktop apps only]

Minimum supported server

None supported


Msinkaut.h (also requires Msinkaut_i.c)



See also

InkOverlay Class
StrokesAdded Event [InkStrokes Collection]
StrokesDeleted Event [InkOverlay Class]
IInkCursor Interface
IInkStrokeDisp Interface