EM_REPLACESEL

An application sends an EM_REPLACESEL message to replace the current selection in an edit control with the text specified by the lParam parameter.

The EM_REPLACESEL 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).

Parameters

wParam

This parameter is not used.

lParam

Points to a null-terminated string containing the replacement text.

Return Value

The return value is always TRUE.

Comments

The EM_REPLACESEL message is used when you want to replace only a portion of the text in an edit control. If you want to replace all of the text, use the WM_SETTEXT message.

If there is no current selection, the replacement text is inserted at the current cursor location.

See Also

WM_SETTEXT