Partager via


InkEdit Control

InkEdit Control

The InkEdit control enables you to collect ink, recognize ink, and display ink as text. This control allows you to enable smart forms, which improves the accuracy of text input.

This control is a superset of the RichEdit Leave Site control. It extends the RichEdit Leave Site control with the ability to capture, recognize, and display ink.

This object can be instantiated by calling the CoCreateInstance Leave Site method in C++ or by using the New keyword in Microsoft® Visual Basic® 6.0.

Members

Enumerations

Enumeration Description
AppearanceConstants Defines values that specify whether the control appears flat or 3-D.
BorderStyleConstants Defines values that specify whether the control has a border.
InkApplicationGesture Defines values that set the interest in a set of application-specific gestures.
InkDisplayMode Defines values that specify whether a selection appears as ink or text.
InkEditStatus Defines values that specify whether the InkEdit control is idle, collecting ink, or recognizing ink.
InkInsertMode Defines values that specify how ink is inserted onto the InkEdit control.
InkMode Defines values that specify the collection mode settings for drawn ink—whether ink collection is disabled, ink is collected, or ink and gestures are collected.
InkMouseButton Defines values that specify which mouse button was pressed.
InkMousePointer Defines values that specify the type of mouse pointer that appears.
MouseButton Defines values that specify which mouse button was pressed.
ScrollBarsConstants Defines values that specify how the scroll bars of an InkEdit control appear on the screen.
SelAlignmentConstants Defines values that specify the alignment of the paragraph relative to the margins of the InkEdit control.

Messages

Event notification message Description
IECN_STROKE This message is sent through a WM_NOTIFY message when a stroke is completed (Win32 only).
IECN_GESTURE This message is sent through a WM_NOTIFY message when a gesture is completed (Win32 only).
IECN_RECOGNITIONRESULT This message is sent through a WM_NOTIFY message when recognition occurs (Win32 only).

Events

Event Description
Change Leave Site Occurs when the contents of the control or a property value change.
Click Leave Site Occurs when the control is clicked.
DblClick Leave Site Occurs when the control is double-clicked.
Gesture Occurs when an application gesture is recognized.
KeyDown Occurs when the user presses a key while the InkEdit control has focus.
KeyPress Occurs when a key is pressed while the InkEdit control has focus.
KeyUp Occurs when a key is released while the InkEdit control has focus.
MouseDown Occurs when the mouse pointer is over the InkEdit control and a mouse button is pressed.
MouseMove Occurs when the mouse pointer is moved over the InkEdit control.
MouseUp Occurs when the mouse pointer is over the InkEdit control and a mouse button is released.
RecognitionResult Occurs when the InkEdit control gets results manually from a call to the InkEdit::Recognize method or automatically after the recognition timeout has fired.
SelChange Leave Site Occurs when the selection of ink within the InkEdit control changes.
Stroke Occurs when the user draws a new IInkStrokeDisp object on any IInkTablet object.

Get/Set Messages

Get/Set message Description
EM_GETINKMODE Gets the ink mode of the control (Win32 only).
EM_SETINKMODE Sets the ink mode of the control (Win32 only).
EM_GETINKINSERTMODE Gets the ink insertion mode of the control (Win32 only).
EM_SETINKINSERTMODE Sets the ink insertion mode of the control (Win32 only).
EM_GETDRAWATTR Gets the current drawing attributes of the control (Win32 only).
EM_SETDRAWATTR Sets the drawing attributes to use for future ink collection (Win32 only).
EM_GETRECOTIMEOUT Gets the recognition timeout for the control (Win32 only).
EM_SETRECOTIMEOUT Sets the recognition timeout for the control (Win32 only).
EM_GETGESTURESTATUS Gets the gesture status for the control (Win32 only).
EM_SETGESTURESTATUS Sets the gesture status for the control (Win32 only).
EM_GETRECOGNIZER Gets the recognizer that the control uses (Win32 only).
EM_SETRECOGNIZER Sets the recognizer that the control uses (Win32 only).
EM_GETFACTOID Gets the factoid to use for recognition (Win32 only).
EM_SETFACTIOD Sets the factoid to use for recognition (Win32 only).
EM_GETSELINK Gets the ink in the selection (Win32 only).
EM_SETSELINK Sets the ink in the selection (Win32 only).
EM_GETSELINKDISPLAYMODE Returns the current appearance of the ink in the selected range by using one of the values of the InkDisplayMode enumeration (Win32 only).
EM_SETSELINKDISPLAYMODE Sets the appearance of the ink in the selected range by using one of the values of the InkDisplayMode enumeration (Win32 only).
EM_GETSTATUS Gets the status of the control (Win32 only).
EM_RECOGNIZE Forces recognition (Win32 only).
EM_GETMOUSEICON Gets the mouse icon (Win32 only).
EM_SETMOUSEICON Sets the mouse icon (Win32 only).
EM_GETMOUSEPOINTER Gets the mouse pointer (Win32 only).
EM_SETMOUSEPOINTER Sets the mouse pointer Win32 only).
EM_GETUSEMOUSEFORINPUT Gets the state of whether mouse input is treated like pen input (Win32 only).
EM_SETUSEMOUSEFORINPUT Sets the state of whether mouse input is treated like pen input (Win32 only).

Methods

Method Description
GetGestureStatus Gets the interest of the InkEdit control in a known set of gestures.
Recognize Specifies that recognition should occur.
SetGestureStatus Sets the interest of the InkEdit control in a known set of gestures.

Properties

Property Description
Appearance Leave Site Gets or sets a value that determines whether the InkEdit control appears flat or 3-D.
BackColor Leave Site Gets or sets the background color for the InkEdit control.
BorderStyle Leave Site Gets or sets a value that determines whether the InkEdit control has a border.
DisableNoScroll Leave Site Gets or sets a value that determines whether scroll bars in the InkEdit control are disabled.
DrawingAttributes Gets or sets the drawing attributes for ink that is yet to be drawn on the InkEdit control.
Enabled Leave Site Gets or sets a value that determines whether the InkEdit control can respond to user-generated events.
Factoid Gets or sets the Factoid constant that a IInkRecognizer object uses to constrain its search for the recognition result.
Font Leave Site Gets or sets the font of the text that the InkEdit control displays.
hWnd Leave Site Gets the window handle to which the InkDisp control is bound.
InkInsertMode Gets or sets a value that specifies how ink is inserted onto the InkEdit control, either as text or as ink.
InkMode Gets or sets a value that specifies whether ink collection is disabled, ink is collected, or ink and gestures are collected.
Locked Leave Site Gets or sets a value that specifies whether the InkEdit control is read-only or not.
MaxLength Leave Site Gets or sets a value indicating whether an InkEdit control can hold a maximum number of characters and, if so, specifies the maximum number of characters.
MouseIcon Leave Site Gets or sets the current custom mouse icon.
MousePointer Leave Site Gets or sets a value that indicates the type of mouse pointer that appears when the mouse is over a particular part of the InkEdit control.
MultiLine Leave Site Gets or sets a value that indicates whether this is a multiline InkEdit control.
RecognitionTimeout Gets or sets the length of time, in milliseconds, between the last IInkStrokeDisp object collected and the beginning of text recognition.
Recognizer Gets or sets the IInkRecognizer object to use for recognition.
ScrollBars Leave Site Gets or sets the type of scroll bars that appear in the InkEdit control.
SelAlignment Leave Site Gets or sets the alignment to apply to the current selection or insertion point (run time only).
SelBold Leave Site Gets or sets a value that specifies whether the font style of the currently selected text in the InkEdit control is bold (run time only).
SelCharOffset Leave Site Gets or sets whether text in the InkEdit control appears on the baseline, as a superscript, or as a subscript (run time only).
SelColor Leave Site Gets or sets the text color of the current text selection or insertion point (run time only).
SelFontName Leave Site Gets or sets the font name of the selected text within the InkEdit control (run time only).
SelFontSize Leave Site Gets or sets the font size of the selected text within the InkEdit control (run time only).
SelInks Gets or sets the array of embedded InkDisp objects (if displayed as ink) that the current selection contains.
SelInksDisplayMode Gets or sets a value that allows toggling the appearance of the selection between ink and text.
SelItalic Leave Site Gets or sets a value that specifies whether the font style of the currently selected text in the InkEdit control is italic (run time only).
SelLength Leave Site Gets or sets the number of characters that are selected in the InkEdit control (run time only).
SelRTF Leave Site Gets or sets the currently selected Rich Text Format (RTF) formatted text in the InkEdit control (run time only).
SelStart Leave Site Gets or sets the starting point of the text that is selected in the text box (run time only).
SelText Leave Site Gets or sets the selected text within the InkEdit control (run time only).
SelUnderline Leave Site Gets or sets a value that specifies whether the font style of the currently selected text in the InkEdit control is underlined (run time only).
Status Gets a value that specifies whether the InkEdit control is idle, collecting ink, or recognizing ink (run time only).
Text Leave Site Gets or sets the current text in the text box.
TextRTF Leave Site Gets or sets the text of the InkEdit control, including all RTF codes.
UseMouseForInput Gets or sets a value that indicates whether the mouse can be used as an input device.

Structures

Structure Description
IEC_STROKEINFO Contains information about a Stroke event (Win32 only).
IEC_GESTUREINFO Contains information about a specific gesture (Win32 only).
IEC_RECOGNITIONRESULTINFO Contains information about a recognition result (Win32 only).

Remarks

For Microsoft Win32® InkEdit applications, be sure to give a transparent window style to added static controls such as group boxes. Otherwise, the InkEdit control cannot collect ink.

You can not use the InkEdit control to render ink in Microsoft Windows® 2000, Windows Server 2003, or any edition of Windows XP other than Windows XP Tablet PC Edition. You can only input ink, accept gestures, or recognize handwriting under the following conditions:

  • Ink can be input and recognized only if Windows XP Tablet PC Edition is installed.
  • Gestures can be recognized only if Windows XP Tablet PC Edition is installed.
  • Handwriting can be recognized as text if the handwriting originated elsewhere and if recognizers are present.

If using Windows 2000, Windows Server 2003, or any edition of Windows XP other than Windows XP Tablet PC Edition, you can assign values to the InkEdit control's ambient properties and can copy and paste ink to other applications, but the value of its InkMode property is always Disabled.

Intelligent space insertion is available only when Windows XP Tablet PC Edition is installed.

Files with embedded InkDisp objects can be loaded and displayed in any edition of Windows XP (including Windows XP Tablet PC Edition) and on systems that may have only the Windows XP Tablet PC Edition Software Development Kit (SDK) installed. However, the embedded InkDisp objects can be converted to text only when Windows XP Tablet PC Edition is installed.

If operations on this control do not succeed, the returned error is a legal HRESULT from either the Microsoft Platform Software Development Kit (SDK) or the Tablet PC SDK Automation API. If error conditions are returned, check the returned HRESULT against both.

For more information about ink controls, see Ink Controls.

The InkEdit control API, both Win32 and Microsoft ActiveX®, is defined in InkEd.h.

For information about which threads raise particular events, see Threads on Which an Event Can Fire.

To improve your application's performance, manually dispose of an InkEdit control when it is no longer needed.

COM Implementation

This object implements the IInkEdit COM interface.