CorrectWriting 

1.0     2.0     

Sends text to the CorrectText dialog box to allow the user to edit text using a single-line or multiline bedit control.

BOOL CorrectWriting( HWND hwnd, LPSTR lpText0, UINT cbText0, LPVOID lpvReserved, DWORD dwFlags, DWORD dwParam )

Parameters

hwnd

Handle of the owner of the CorrectText dialog box or writing tools used to edit the text.

lpText0

Far pointer to a buffer containing the text to be corrected.

When CorrectWriting returns, the lpText0 buffer holds the corrected text. As a general rule, this parameter should allow for growth by a factor of at least two or some maximum size that depends on the field of entry.

cbText0

Number of characters in lpText0. This value must be greater than 1 and include a byte for the string s null terminator.

lpvReserved

This parameter is reserved and should be set to NULL.

dwFlags

Translation and style flags, formed by the low-order word and high-order word of dwFlags. The low-order word must be one or more of the following flags, combined with the bitwise-OR operator. Note that the CWR_REPLACECR and CWR_REPLACETAB flags replace CWR_STRIPTAB and CWR_STRIPCR, respectively; both flags are in version 1.0 of the Pen API.

Constant

Description

CWR_BOXES

Create bedit writing tool instead of keyboard. This flag can be used only for edit control and its derivatives. Use of this flag by applications is not recommended.

CWR_HEDIT

Indicates that the given hwnd is an edit control or a control derived from the edit control. This flag can be used only for edit control and its derivatives. Use of this flag by applications is not recommended.

CWR_INSERT

Use  Insert Text  instead of  Edit Text  as the title. CWR_TITLE overrides this flag.

CWR_KEYBOARD

Create keyboard writing tool instead of bedit lens. This flag can be used only for edit control and its derivatives. Use of this flag by applications is not recommended.

CWR_KKCONVERT

Initiate IME (Japanese version only).

CWR_REPLACECR

Replace carriage return characters in the text in the buffer by spaces just before the call returns.

CWR_REPLACETAB

Replace tabs in the text in the buffer by spaces just before the call returns.

CWR_SIMPLE

Use writing tool (simple dialog box). This flag can be used only for an edit control and its derivatives. Use of this flag by applications is not recommended.

CWR_SINGLELINEEDIT

Replace carriage returns and tabs with spaces and strip linefeeds from the text in the buffer just before the call returns.

CWR_STRIPLF

Strip linefeed characters from the text in the buffer just before the call returns.

CWR_TITLE

Interpret dwParam (see below) as a pointer to the title text string.

 

The high-order word must be one of the following values and cannot be combined with the bitwise-OR operator. The values determine the type of keyboard to show when the user clicks the keyboard button in the dialog box.

Constant

Description

CWRK_TELPAD

Use the telephone-type keyboard.

CWRK_BASIC

Use the basic keyboard.

CWRK_DEFAULT

Use the default keyboard type. The default keyboard type is currently the same as the basic keyboard type.

CWRK_FULL

Use the full keyboard.

CWRK_NUMPAD

Use the numeric keyboard.

 

dwParam

A far pointer to a text string that serves as the title of the dialog box if CWR_TITLE is present in dwFlags; otherwise, this parameter must be 0.

Return Value

Returns TRUE if the writing tool or CorrectWriting operation was successful. Otherwise, the return value is FALSE.

Comments

CorrectWriting sends a WM_PENMISC message with PMSC_GETHRC as the lParam to the specified window. This message requests the HRC handle associated with the window, which the system then uses for the dialog box. The window should return a copy of its HRC so that the system can destroy it before the call returns. If the window returns NULL to this message, the system creates a default HRC.

Note that in the Japanese version, CorrectWriting is supported but internally calls CorrectWritingEx1AOBT7, which opens a Dialog Input Window.