WM_SETTEXT

2.x

WM_SETTEXT
wParam = 0;                         /* not used, must be zero        */
lParam = (LPARAM) (LPCSTR) pszText; /* address of window-text string */

An application sends a WM_SETTEXT message to set the text of a window.

Parameters

pszText

Value of lParam. Points to a null-terminated string that is the window text.

Return Value

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.

Comments

For an edit control, the text to be set is the contents of the edit control. For a combo box, the text is the contents of the edit-control (or static-text) portion of the combo box. For a button, the text is the button name. For other windows, the text is the window title.

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 item in the list box that matches the text in the edit control.

See Also

WM_GETTEXT