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


int WINAPI 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

Type: const WCHAR*

Autocorrect candidate string.

pszAfter

Type: WCHAR*

Resulting autocorrect string, if the return value is not ATP_NOCHANGE.

cchAfter

Type: LONG

Count of characters in pszAfter.

pcchReplaced

Type: LONG*

Count of trailing characters in pszBefore to replace with pszAfter.

Return value

Type: int

Returns one or more of the following values.

Return code/valueDescription
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]

Header

Richedit.h

See also

EM_CALLAUTOCORRECTPROC
EM_GETAUTOCORRECTPROC
EM_SETAUTOCORRECTPROC

 

 

Community Additions

ADD
Show:
© 2014 Microsoft