EditWordBreakProcEx callback function

The EditWordBreakProcEx function is an application defined callback function used with the EM_SETWORDBREAKPROCEX message. It determines the character index of the word break or the character class and word-break flags of the characters in the specified text. The EDITWORDBREAKPROCEX type defines a pointer to this callback function. EditWordBreakProcEx is a placeholder for the application-defined function name.


LONG CALLBACK EditWordBreakProcEx(
  _In_ char *pchText,
  _In_ LONG cchText,
  _In_ BYTE bCharSet,
  _In_ INT  code


pchText [in]

Type: char*

Pointer to the text at the current position. If code specifies movement to the left, the text is in the elements pchText [–1] through pchText [-cchText], and pchText[0] is undefined. For all other actions, the text is in the elements pchText[0] through pchText[ cchText–1].

cchText [in]

Type: LONG

Number of characters in the buffer in the direction specified by code.

bCharSet [in]

Type: BYTE

Character set of the text.

code [in]

Type: INT

Word break action. Can be one of the values described for the code parameter in the EM_FINDWORDBREAK message.

Return value

Type: LONG

The function returns a value based on the code parameter.

Return codeDescription
code parameter

Return value


Returns the character class and word-break flags of the character at the specified position.


Returns TRUE if the character at the specified position is a delimiter or FALSE if the character is not.

All other values

Returns the character index of the word break.



An application must install the callback function by specifying the address of the callback function in an EM_SETWORDBREAKPROCEX message.

For Microsoft Rich Edit 2.0 and later, Rich Edit no longer supports EditWordBreakProcEx. Users can send EM_SETWORDBREAKPROC to set EditWordBreakProc, which is now enhanced to support the passing of Unicode text.


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]



See also




Community Additions

© 2015 Microsoft