An application sends an EM_REPLACESEL message to replace the current selection in an edit control with the specified text.
EM_REPLACESEL fCanUndo = (BOOL) wParam ; // flag that specifies whether replacement can be undone lpszReplace = (LPCTSTR) lParam ; // pointer to replacement text string
This message does not return a value.
Use the EM_REPLACESEL message to replace only a portion of the text in an edit control. 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 location of the caret.