In my C++ Win32 GUI application I have a dialog with an edit control created from a dialog template:
EDITTEXT IDC_EDIT_Id, X, Y, W, H,
ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
Whenever I manually input multiline text with carriage returns and call GetWindowText()
the retrieved text is broken into lines with CR
and LF
characters as expected. However when I try to put the same text back into the edit control with SetWindowText()
the control displays that text as a single string.
Why does it exhibit such behaviour and how do I workaround this?