EM_SETWORDBREAK

This message is sent to the multiline edit control, informing the edit control that Windows has replaced the default word-break function with an application-supplied word-break function. A word-break function scans a text buffer (which contains text to be sent to the display), looking for the first word that will not fit on the current display line. The word-break function places this word at the beginning of the next line on the display. A word-break function defines at what point Windows should break a line of text for multiline edit controls, usually at a blank character that separates two words. The default word-break function breaks a line of text at a blank character. The application-supplied function may define a word break to be a hyphen or character other than the blank character.

Parameter Description  

wParam Is not used.  
lParam Is a procedure-instance address.  

Comments

The callback-function address, passed as the lParam parameter, must be created by using the MakeProcInstance function.

The callback function must use the Pascal calling convention and must be declared FAR.

Callback Function

LPSTR FAR PASCAL WordBreakFunc(lpchEditText, ichCurrentWord, cchEditText)
LPSTR lpchEditText;
short ichCurrentWord;
short cchEditText;

WordBreakFunc is a placeholder for the application-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the application's module-definition file.

Parameter Description  

lpchEditText Points to the text of the edit control.  
ichCurrentWord Specifies an index to a word in the buffer of text that identifies at what point the function should begin checking for a word break.  
cchEditText Specifies the number of bytes of edit text.  

Return Value

The return value points to the first byte of the next word in the edit-control text. If the current word is the last word in the text, the return value points to the first byte that follows the last word.