ProcessWriting

  1. 0 2.0

Processes handwriting.

Note This function is provided only for compatibility with version 1.0 of the Pen API and will not be supported in future versions. Use DoDefaultPenInput instead.

REC ProcessWriting( HWND hwnd, LPRC lprc )

Parameters

hwnd

Window to receive messages. This parameter must not be NULL.

lprc

Address of RC structure to use for recognition. This parameter can be NULL.

Return Value

Returns values less than 0 if the application should treat the event as a mouse event instead of a pen event. Return values less than 0 occur if the event did not come from a pen, the user performed a press-and-hold action (REC_POINTEREVENT), or an error occurredpics/PENAPI00090001.giffor example, running out of memory.

Comments

The ProcessWriting function is similar to Recognize except that ProcessWriting also takes care of inking, removing the ink, and converting the results message to standard Windows messages.

Depending on the existing code in an application, ProcessWriting may not be suitable for making an application pen-aware. This function can also limit the power of a pen interface.

If lprc is NULL, a default RC structure is created for the application. The default RC structure contains all system defaults and the inking is constrained to the client area of hwnd. If lprc points to a valid RC structure, the rectBound member of the RC structure is used to constrain the inking. Regardless of whether the application provides an RC or not, ProcessWriting assumes a value of RRM_COMPLETE for the wResultMode member. See RC for a description of wResultMode and the RRM_ values.

After the writing is completed, the ink is removed before any messages are sent to hwnd. After the ink is removed, the screen is updated and hwnd receives a WM_RCRESULT message. If the application processes this message, it should return TRUE. In this case, no further messages are sent.

If the application returns FALSE, ProcessWriting performs the default conversion of the results message to standard Windows messages, as shown in the following table. The messages are sent rather than posted. Note that the DefWindowProc function returns 0 when processing the WM_RCRESULT message.

Results message
Windows message
SYV_BACKSPACE
WM_LBUTTONDOWN, followed by WM_LBUTTONUP at the hot spot of the gesture, followed by WM_CHAR specifying a backspace.
SYV_CLEAR
WM_CLEAR.
SYV_CLEARWORD
WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP at the same point, followed by WM_CLEAR.
SYV_COPY
WM_COPY.
Results message
Windows message
SYV_CORRECT
WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP at the hot spot of the gesture, followed by WM_COPY. At this point the Edit Text dialog box is activated; it retrieves text from the Clipboard. This uses the existing selection, if any. The previous contents of the Clipboard are lost.
SYV_CUT
WM_CUT.
SYV_EXTENDSELECT
WM_LBUTTONDOWN, followed by WM_LBUTTONUP at the hot spot of the gesture.
The MK_SHIFT flag is set for the wParam of these messages.
SYV_LASSO
WM_LBUTTONDOWN at upper-left corner of selected area, followed by WM_MOUSEMOVE message, followed by WM_LBUTTONUP at the lower-right corner of selected area.
SYV_PASTE
WM_LBUTTONDOWN, followed by WM_LBUTTONUP at the hot spot of the gesture, followed by WM_PASTE.
SYV_RETURN
WM_LBUTTONDOWN, followed by WM_LBUTTONUP at the hot spot of the gesture, followed by WM_CHAR specifying a carriage return.
SYV_SPACE
WM_LBUTTONDOWN, followed by WM_LBUTTONUP at the hot spot of the gesture, followed by WM_CHAR specifying a space.
SYV_TAB
WM_LBUTTONDOWN, followed by WM_LBUTTONUP at the hot spot of the gesture, followed by WM_CHAR specifying a tab.
SYV_UNDO
WM_UNDO.
text
One WM_CHAR message per character of text.

The SYV_ symbol values in the previous table identify gestures. To see a complete list of symbol values, refer to Chapter 13, "Pen Application Programming Interface Constants."

The lParam of a WM_RCRESULT message generated by ProcessWriting is a far pointer to an RCRESULT structure. By default, when an application receives a WM_RCRESULT message, the hpendata member of the RCRESULT structure is NULL. If you need the HPENDATA handle, set the RCO_SAVEHPENDATA flag in the lRcOptions member of the RC structure. In this case, the calling application is responsible for destroying the HPENDATA object.

See Also

DoDefaultPenInput
, InitRC, Recognize, REC_, SYV_, RCO_

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database