Help Center

CRichEdit.SetWordBreakProcmethod

Replaces a rich edit control's default Wordwrap function with an application-defined wordwrap function.

Windowsmethoddocumented

Syntax

SUB SetWordBreakProc (BYVAL hRichEdit AS HWND, BYVAL pfn AS LONG_PTR)

Parameters

NameDescription
hRichEditThe handle of the rich edit control.
pfnThe address of the application-defined Wordwrap function. For more information about breaking lines, see the description of the EditWordBreakProc callback function.

Description

Replaces a rich edit control's default Wordwrap function with an application-defined Wordwrap function.

Remarks

A Wordwrap function scans a text buffer that contains text to be sent to the screen, looking for the first word that does not fit on the current screen line. The Wordwrap function places this word at the beginning of the next line on the screen.

A Wordwrap function defines the point at which the system should break a line of text for multiline edit controls, usually at a space character that separates two words. Either a multiline or a single-line edit control might call this function when the user presses arrow keys in combination with the CTRL key to move the caret to the next word or previous word. The default Wordwrap function breaks a line of text at a space character. The application-defined function may define the Wordwrap to occur at a hyphen or a character other than the space character.

Rich Edit: Supported in Microsoft Rich Edit 1.0 and later.

Reference

  • Defined in AfxNova/CRichEdit.inc:1279
  • Documented in Windows/WIndows Controls/CRichEdit Class.md
  • Topic: CRichEdit Class