Partager via


HwxSetAbort

This function sets an address that the handwriting recognition engine checks to determine if more user input, or ink, is available. If the address, which is the number of strokes collected for a character, indicates more ink is available, the handwriting recognition engine aborts. It can then be called again to include the new ink in its processing. If the stroke counter indicates that no new ink is available, the handwriting recognition engine continues processing.

BOOL HwxSetAbort( 
  HRC hrc, 
  UINT* pnumstrokes 
);

Parameters

  • hrc
    [in] Handle of the handwriting recognition context (HRC) object.
  • pnumstrokes
    [in] Pointer to the number of strokes currently in the handwriting recognition context (HRC). A stroke consists of stylus down, stylus movement, and stylus lift.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call the GetLastError function.

Remarks

Use this function after a call to the HwxSetPartial function. Partial recognition processing works best in a multithreaded operating environment. This enables a single application process to have one thread collecting user input, or ink, and another thread processing ink, with both threads sharing the same memory address space. The thread that processes ink, or the recognition thread, uses the address pointed to by pnumstrokes as a signal to stop recognition processing when the collection thread has more ink for the recognition thread to work with. If the contents of that address do not match the number of strokes that the handwriting recognition engine — the recognition thread — is currently processing, then processing stops As long as pnumstrokes matches the number of strokes that the handwriting recognition engine is processing, processing continues.

To resume processing after an abort, the recognition thread calls the HwxProcess function.

Two stroke counters are maintained for the current character or glyph. One is in your application and the other is an internal stroke count. The application counter must be incremented when the stylus touches the input box, because it is starting a new stroke. When the stroke is done — that is, when the stylus is raised from the input box — HwxInput is called. HwxInput adds the stroke information to the character or glyph data and increments the internal stroke count for the character or glyph. While the user is putting the stroke information in the input box, the two counters are different.

Set pnumstrokes to point to the application stroke count. When HwxSetPartial has been called for this character or glyph and there is a new stroke in the input box, calling HwxSetAbort causes the partial recognition process to stop. The application then includes the new data in the information it is using for recognition.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Recog.h.
Link Library: Hwxjpn.lib, Hwxusa.lib, Hwxcht.lib, Hwxkor.lib.

See Also

HwxInput | HwxProcess | HwxSetPartial

 Last updated on Friday, April 09, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.