Skip to content

Latest commit

 

History

History
75 lines (46 loc) · 2.16 KB

em-replacesel.md

File metadata and controls

75 lines (46 loc) · 2.16 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
EM_REPLACESEL message (Winuser.h)
Replaces the selected text in an edit control or a rich edit control with the specified text.
525e6f5a-f52f-4bab-bc76-caa484729897
EM_REPLACESEL message Windows Controls
apiref
EM_REPLACESEL
Winuser.h
HeaderDef
reference
05/31/2018

EM_REPLACESEL message

Replaces the selected text in an edit control or a rich edit control with the specified text.

Parameters

wParam

Specifies whether the replacement operation can be undone. If this is TRUE, the operation can be undone. If this is FALSE , the operation cannot be undone.

lParam

A pointer to a null-terminated string containing the replacement text.

Return value

This message does not return a value.

Remarks

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 selection, the replacement text is inserted at the caret.

Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.

In a rich edit control, the replacement text takes the formatting of the character at the caret or, if there is a selection, of the first character in the selection.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Winuser.h (include Windows.h)

See also

WM_SETTEXT