AutoCorrectProc callback function

The AutoCorrectProc function is an application-defined callback function that is used with the EM_SETAUTOCORRECTPROC message.

AutoCorrectProc is a placeholder for the application-defined function name. It provides application-defined automatic error correction for text entered into a rich edit control.

Syntax

AutoCorrectProc Autocorrectproc;

int Autocorrectproc(
  LANGID langid,
  const WCHAR *pszBefore,
  WCHAR *pszAfter,
  LONG cchAfter,
  LONG *pcchReplaced
)
{...}

Parameters

langid

Type: LANGID

Language ID that identifies the autocorrect file to use for automatic correcting.

pszBefore

pszAfter

cchAfter

Type: LONG

Count of characters in pszAfter.

pcchReplaced

Return Value

Type: int

Returns one or more of the following values.

Return code/value Description
ATP_NOCHANGE
0
No change.
ATP_CHANGE
1
Change but don’t replace most delimiters, and don’t replace a span of unchanged trailing characters (preserves their formatting).
ATP_NODELIMITER
2
Change but don’t replace a span of unchanged trailing characters.
ATP_REPLACEALLTEXT
4
Replace trailing characters even if they are not changed (uses the same formatting for the entire replacement string).

Requirements

   
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header richedit.h

See Also

EM_CALLAUTOCORRECTPROC

EM_GETAUTOCORRECTPROC

EM_SETAUTOCORRECTPROC