WM_CUT

2.x

WM_CUT
wParam = 0;     /* not used, must be zero */
lParam = 0L;    /* not used, must be zero */

An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format.

Parameters

This message has no parameters.

Return Value

The return value is nonzero if this message is sent to an edit control or a combo box.

Comments

An EM_UNDO message can be sent to the edit control to undo the deletion performed by the WM_CUT message.

To delete the current selection without placing the deleted text onto the clipboard, use the WM_CLEAR message.

Example

This example sends an EM_SETSEL message to select the entire contents of an edit control. It then sends a WM_CUT message to delete the contents of the edit control and to copy the deleted text to the clipboard.

SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
    EM_SETSEL, 0, MAKELONG(0, -1));
SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
    WM_CUT, 0, 0L);

See Also

WM_CLEAR, WM_COPY, WM_PASTE