int CALLBACK WordBreakProc(lpszEditText, ichCurrentWord, cbEditText, action) | |||||
LPSTR lpszEditText; | /* address of edit text | */ | |||
int ichCurrentWord; | /* index of starting point | */ | |||
int cbEditText; | /* length of edit text | */ | |||
int action; | /* action to take, */ |
The WordBreakProc function is an application-defined callback function that the system calls whenever a line of text in a multiline edit control must be broken.
lpszEditText
Points to the text of the edit control.
ichCurrentWord
Specifies an index to a word in the buffer of text that identifies the point at which the function should begin checking for a word break.
cbEditText
Specifies the number of bytes in the text.
action
Specifies the action to be taken by the callback function. This parameter can be one of the following values:
Value | Action |
WB_LEFT | Look for the beginning of a word to the left of the current position. |
WB_RIGHT | Look for the beginning of a word to the right of the current position. |
WB_ISDELIMITER | Check whether the character at the current position is a delimiter. |
If the action parameter specifies WB_ISDELIMITER, the return value is non-zero (TRUE) if the character at the current position is a delimiter, or zero if it is not. Otherwise, the return value is an index to the begining of a word in the buffer of text.
A carriage return (CR) followed by a linefeed (LF) must be treated as a single word by the callback function. Two carriage returns followed by a linefeed also must be treated as a single word.
An application must install the callback function by specifying the procedure-instance address of the callback function in a EM_SETWORDBREAKPROC message.
WordBreakProc is a placeholder for the library-defined function name. The
actual name must be exported by including it in an EXPORTS statement in the
library's module-definition file.