This message is used to set the text of a window. For edit controls and combo-box edit controls, the text to be set is the content of the edit control. For button controls, the text is the button name. For other windows, the text is the window caption.
The WM_SETTEXT message may be used as either a wide-character message (where text arguments must use Unicode) or an ANSI message (where text arguments must use characters from the Windows 3.x character set installed).
wParam
This parameter is not used.
lParam
Points to a null-terminated string that is the window text.
The return value is LB_ERRSPACE (for a list box) or CB_ERRSPACE (for a combo box) if insufficient space is available to set the text in the edit control. It is CB_ERR if this message is sent to a combo box without an edit control.
This message does not change the current selection in the list box of a combo box. An application should use the CB_SELECTSTRING message to select the list-box item which matches the text in the edit control.