Microsoft Windows Edit Control Messages

The window procedure for the predefined edit control window class carries out default processing for all messages that the edit control procedure does not process. When the edit control procedure returns FALSE for any message, the predefined window procedure checks the messages and carries out the following default actions.
MessageDefault Action
EM_CANUNDOReturns TRUE if the edit control operation can be undone.
EM_CHARFROMPOSReturns the character index and line index of the character nearest the specified point.
EM_EMPTYUNDOBUFFEREmpties the undo buffer and sets the undo flag retrieved by the EM_CANUNDO message to FALSE. Windows automatically clears the undo flag whenever the edit control receives a WM_SETTEXT or EM_SETHANDLE message.
EM_FMTLINESAdds or removes soft linebreak characters (two carriage returns and a linefeed) to the ends of wrapped lines in a multiline edit control. It is not processed by single-line edit controls.
EM_GETFIRSTVISIBLELINEReturns the zero-based index of the first visible character in a single-line edit control or the zero-based index of the uppermost visible line in a multiline edit control.
EM_GETHANDLEReturns a handle identifying the buffer containing the multiline edit control's text. It is not processed by single-line edit controls.
EM_GETLIMITTEXTReturns the current text limit, in characters.
EM_GETLINECopies characters in a single-line edit control to a buffer and returns the number of characters copied. In a multiline edit control, retrieves a line of text from the control and returns the number of characters copied.
EM_GETLINECOUNTReturns the number of lines in the edit control.
EM_GETMARGINSReturns the widths of the left and right margins.
EM_GETMODIFYReturns a flag indicating whether the content of an edit control has been modified.
EM_GETPASSWORDCHARReturns the character that edit controls use in conjunction with the ES_PASSWORD style.
EM_GETRECTReturns the coordinates of the formatting rectangle in an edit control.
EM_GETSELReturns the starting and ending character positions of the current selection in the edit control.
EM_GETTHUMBReturns the position of the scroll box.
EM_GETWORDBREAKPROCReturns the address of the current wordwrap function in an edit control.
EM_LINEFROMCHARReturns the zero-based number of the line in a multiline edit control that contains a specified character index This message is the reverse of the EM_LINEINDEX message. It is not processed by single-line edit controls.
EM_LINEINDEXReturns the character of a line in a multiline edit control. This message is the reverse of the EM_LINEFROMCHAR message. It is not processed by single-line edit controls.
EM_LINELENGTHReturns the length, in characters, of a single-line edit control. In a multiline edit control, returns the length, in characters, of a specified line.
EM_LINESCROLLScrolls the text vertically in a single-line edit control or horizontally in a multiline edit control (when the control has the ES_LEFT style). The lParam parameter specifies the number of lines to scroll vertically, starting from the current line. The wParam parameter specifies the number of characters to scroll horizontally, starting from the current character.
EM_POSFROMCHARReturns the client coordinates of the specified character.
EM_REPLACESELReplaces the current selection with the text in an application-supplied buffer, sends the parent window EN_UPDATE and EN_CHANGE messages, and updates the undo buffer.
EM_SCROLLScrolls the text vertically in a multiline edit control. This message is equivalent to sending a WM_VSCROLL message to the edit control. It is not processed by single-line edit controls.
EM_SCROLLCARETScrolls the caret into view in an edit control. In earlier versions of Windows this was done via EM_SETSEL using particular parameters. A Win32-based application should use EM_SCROLLCARET.
EM_SETFONTUnsupported.
EM_SETHANDLESets a handle to the memory used as a text buffer, empties the undo buffer, resets the scroll positions to zero, and redraws the window.
EM_SETLIMITTEXTSets the maximum number of characters the user may enter in the edit control. For single-line edit controls, this value is either 0x7FFFFFFE (0x7FFE for version 4.0) or the value of the wParam parameter, whichever is smaller. For multiline edit controls, this value is either 0xFFFFFFFF (0xFFFF for version 4.0) or the value of the wParam parameter, whichever is smaller.
EM_SETMARGINSSets the widths of the left and right margins, and redraws the edit control to reflect the new margins.
EM_SETMODIFYSets or clears the modification flag to indicate whether the edit control has been modified.
EM_SETPASSWORDCHARDefines the character that edit controls use in conjunction with the ES_PASSWORD style.
EM_SETREADONLYSets or removes the read-only style (ES_READONLY) in an edit control.
EM_SETRECTSets the formatting rectangle for the multiline edit control and redraws the window. It is not processed by single-line edit controls.
EM_SETRECTNPSets the formatting rectangle for the multiline edit control but does not redraw the window. It is not processed by single-line edit controls.
EM_SETSELSelects a range of characters in the edit control by setting the starting and ending positions to be selected.
EM_SETTABSTOPSSets tab-stop positions in the multiline edit control. It is not processed by single-line edit controls.
EM_SETWORDBREAKPROCReplaces the default wordwrap function with an application-defined wordwrap function.
EM_UNDORemoves any text that was just inserted or inserts any deleted characters and sets the selection to the inserted text. If necessary, sends the EN_UPDATE and EN_CHANGE notification messages to the parent window.
WM_CHARWrites a character to the single-line edit control and sends the EN_UPDATE and EN_CHANGE notification messages to the parent window. Writes a character to the multiline edit control. Handles the accelerator keys for standard functions, such as CTRL+C for copying and CTRL+V for pasting. In multiline edit controls, also processes TAB, and CTRL+TAB keystrokes to move among the controls in a dialog box and to insert tabs into multiline edit controls. Uses the MessageBeep function for illegal characters.
WM_CLEARClears the current selection, if any, in an edit control. If there is no current selection, deletes the character to the right of the caret. If the user presses the SHIFT key, this cuts the selection to the clipboard, or deletes the character to the left of the caret when there is no selection. If the user presses the CTRL key, this deletes the selection, or deletes to the end of the line when there is no selection.
WM_COPYCopies text to the clipboard unless the style is ES_PASSWORD, in which case the message returns zero.
WM_CREATECreates the edit control and notifies the parent window with TRUE for success or -1 for failure.
WM_CUTCuts the selection to the clipboard, or deletes the character to the left of the cursor if there is no selection.
WM_ENABLECauses the rectangle to be redrawn in gray for single-line edit controls. Returns the enabled state for single-line and multiline edit controls.
WM_ERASEBKGNDFills the multiline edit control window with the current color of the edit control.
WM_GETDLGCODEReturns the following values: DLGC_WANTCHARS, DLGC_HASSETSEL, and DLGC_WANTARROWS. In multiline edit controls, it also returns DLGC_WANTALLKEYS. If the user presses ALT+BACKSPACE, it also returns DLGC_WANTMESSAGE.
WM_GETFONTReturns the handle of the font being used by the control, or NULL if the control uses the system font.
WM_GETTEXTCopies the specified number of characters to a buffer and returns the number of characters copied.
WM_GETTEXTLENGTHReturns the length, in characters, of the text in an edit control. The length does not include the null- terminating character.
WM_HSCROLLScrolls the text in a multiline edit control horizontally and handles scroll box movement.
WM_KEYDOWNPerforms standard processing of the virtual-key codes.
WM_KILLFOCUSRemoves the keyboard focus of an edit control window, destroys the caret, hides the current selection, and notifies the parent window that the edit control has lost the focus.
WM_LBUTTONDBLCLKClears the current selection and selects the word under the cursor. If the SHIFT key is down, extends the selection to the word under the cursor.
WM_LBUTTONDOWNChanges the current insertion point. If the SHIFT key is down, it extends the selection to the position of the cursor. In multiline edit controls, also sets the timer to automatically scroll when the user holds down the mouse button outside the multiline edit control window.
WM_LBUTTONUPReleases the mouse capture and sets the text insertion point in the single-line edit control. In a multiline edit control, it also kills the timer set in the WM_LBUTTONDOWN message.
WM_MOUSEMOVEChanges the current selection in the single-line edit control, if the mouse button is down. In a multiline edit controls, also sets the timer to automatically scroll if the user holds down the mouse button outside the multiline edit control window.
WM_NCCREATEPoints to the CREATESTRUCT structure for the window. This message is sent to the WM_CREATE message when a window is first created.
WM_NCDESTROYFrees all memory associated with the edit control window, including the text buffer, undo buffer, tab-stop buffer, and highlight brush.
WM_PAINTErases the background, fills the window with the current color of the edit control window, draws the border (if any), sets the font and draws any text, and shows the text-insertion caret.
WM_PASTEPastes text from the clipboard into the edit control window at the caret position.
WM_SETFOCUSSets the keyboard focus of an edit control window (shows the current selection, if it was hidden, and creates the caret).
WM_SETFONTSets the font and optionally redraws the edit control.
WM_SETTEXTCopies text to the single-line edit control, notifies the parent window when there is insufficient memory, empties the undo buffer, and sends the EN_UPDATE and EN_CHANGE notification messages to the parent window. In multiline edit controls, also rewraps the lines (if necessary) and sets the scroll positions.
WM_SIZEChanges the size of the edit control window and ensures that the minimum size accommodates the height and width of a character.
WM_SYSCHARReturns TRUE if the user presses ALT+BACKSPACE; otherwise, it takes no action.
WM_SYSKEYDOWNUndoes the last action if the user presses ALT+BACKSPACE; otherwise, it takes no action.
WM_TIMERScrolls the text in the edit control window if the user holds down the mouse button outside the multiline edit control window.
WM_UNDORemoves any text that was just inserted or inserts any deleted characters and sets the selection to the inserted text. If necessary, sends the EN_UPDATE and EN_CHANGE notification messages to the parent window.
WM_VSCROLLScrolls a multiline edit control vertically and handles scroll box movement. It is not processed by single-line edit controls.


The layout of above table was generated by a Common Lisp program :-)

转载于:https://www.cnblogs.com/feisimple/archive/2006/10/12/526949.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值