5.7.2 Edit-Control Messages

Edit-control messages are sent by an application to an edit control. In addition to the messages described below, the WM_ENABLE, WM_GETTEXT, WM_GETTEXTLENGTH, WM_KILLFOCUS, WM_SETFOCUS, WM_SETREDRAW, and WM_SETTEXT window messages can be used. The following list briefly describes each edit-control message:

Message Description  
EM_CANUNDO Determines whether or not an edit control can respond correctly to an EM_UNDO message.  
EM_EMPTYUNDOBUFFER Disables an edit control's ability to undo the last edit.  
EM_FMTLINES Directs the edit control to add or remove the end-of-line character from wordwrapped text lines.  
EM_GETHANDLE Returns the data handle of the buffer used to hold the contents of the control window.  
EM_GETLINE Copies a line from the edit control.  
EM_GETLINECOUNT Returns the number of lines of text in the edit control.  
EM_GETMODIFY Returns the current value of the modify flag for a given edit control. The flag is set by the control if the user enters or modifies text within the control.  
EM_GETRECT Returns the formatting rectangle of the edit control.  
EM_GETSEL Returns the starting and ending character positions of the current selection.  
EM_LIMITTEXT Limits the length of the text (in bytes) the user may enter.  
EM_LINEFROMCHAR Returns the line number of the line that contains the character whose position (indexed from the beginning of the text) is specified by the
wParam
parameter.
 
EM_LINEINDEX Returns the number of character positions that occur before the first character in a given line.  
EM_LINELENGTH Returns the length of a line (in bytes) in the edit control's text buffer.  
EM_LINESCROLL Scrolls the contents of the edit control by the given number of lines.  
Message Description  
EM_REPLACESEL Replaces the current selection with new text.  
EM_SETHANDLE Establishes the text buffer used to hold the contents of the edit-control window.  
EM_SETMODIFY Sets the modify flag for a given edit
control.
 
EM_SETPASSWORDCHAR Changes the password character for an edit control created with the ES_PASSWORD styles.  
EM_SETRECT Sets the formatting rectangle for an edit control.  
EM_SETRECTNP Identical to EM_SETRECT, except that the control is not repainted.  
EM_SETSEL Selects all characters in the current text that are within the starting and ending character positions given by the lParam parameter.  
EM_SETTABSTOPS Sets tab-stop positions in a multiline edit control.  
EM_SETWORDBREAK Informs a multiline edit control that Windows has replaced the default word-break function with an application-supplied word-break function.  
EM_UNDO Undoes the last edit in an edit control.  
WM_CLEAR Deletes the current selection.  
WM_COPY Sends the current selection to the clipboard in CF_TEXT format.  
WM_CUT Sends the current selection to the clipboard in CF_TEXT format, and then deletes the selection from the control window.  
WM_PASTE Inserts the data from the clipboard into the control window at the current cursor position.  
WM_UNDO Undoes the previous action.