EM_FMTLINES
wParam = (WPARAM) (BOOL) fAddEOL; /* line break flag */
lParam = 0L; /* not used, must be zero */
An application sends an EM_FMTLINES message to set the inclusion of soft line break characters on or off within a multiline edit control. A soft line break consists of two carriage returns and a linefeed inserted at the end of a line that is broken because of wordwrapping.
This message is processed only by multiline edit controls.
fAddEOL
Value of wParam. Specifies whether soft line break characters are to be inserted. A value of TRUE inserts the characters; a value of FALSE removes them.
The return value is identical to the fAddEOL parameter.
This message affects only the buffer returned by the EM_GETHANDLE message and the text returned by the WM_GETTEXT message. It has no effect on the display of the text within the edit control.
A line that ends with a hard line break is not affected by the EM_FMTLINES message. A hard line break consists of one carriage return and a linefeed.
This example sends an EM_FMTLINES message to turn off soft line breaks, then allocates a buffer for the text, and then retrieves the text by sending a WM_GETTEXT message:
WPARAM cbText;
HGLOBAL hmem;
LPSTR lpstr;
SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
EM_FMTLINES, FALSE, 0);
cbText = (WPARAM) SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
WM_GETTEXTLENGTH, 0, 0L);
cbText++; /* make room for the terminating null character */
hmem = (HGLOBAL) GlobalAlloc(GMEM_MOVEABLE, (DWORD) cbText);
lpstr = GlobalLock(hmem);
SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
WM_GETTEXT, cbText, (LPARAM) lpstr);