原文地址:http://hi.baidu.com/fangenhong/item/34def0c1fa2f242846d5c035
EM_CANUNDO Message
判断编辑控件的“取消”队列中是否有任何行为。你可以将该消息发送给常规编辑控件也可以发送给富编辑控件。
语法
lResult = SendMessage( // returns LRESULT in lResult
hWndControl, // (HWND) handle to destination control
EM_CANUNDO, // (UINT) message ID
wParam, // = 0; not used, must be zero
lParam // = 0L; not used, must be zero
);
参数
wParam
未使用,必须为0
lParam
未使用,必须为0.
返回值
如果“取消”队列中有尚未完成的行为,返回值是非零值;否则,返回零值。
备注
如果“取消”队列不空,你可以发送EM_UNDO消息给控件来取消最近的操作。
对于编辑控件和富编辑控件1.0,取消队列仅包含有最近的操作。
对于富编辑控件2.0及后续版本,取消队列可以波阿含多个操作。
消息信息
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1
以下是msdn的结果:
/*
EM_CANUNDO
The EM_CANUNDO message determines whether there are any actions in an edit control's undo queue. You can send this message to either an edit control or a rich edit control.
To send this message, call the SendMessage function with the following parameters.
SendMessage(
(HWND) hWnd, // handle to destination window
EM_CANUNDO, // message to send
(WPARAM) wParam, // not used; must be zero
(LPARAM) lParam // not used; must be zero
);
Parameters
This message has no parameters.
Return Values
If there are actions in the control's undo queue, the return value is nonzero.
If the undo queue is empty, the return value is zero.
Remarks
If the undo queue is not empty, you can send the EM_UNDO message to the control to undo the most recent operation.
Edit controls and Rich Edit 1.0: The undo queue contains only the most recent operation.
Rich Edit 2.0 and later: The undo queue can contain multiple operations.
Rich Edit: For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Version: Requires Rich Edit 1.0 or later.
Header: Declared in Winuser.h; include Windows.h.
*/
/*
EM_UNDO
The EM_UNDO message undoes the last edit control operation in the control's undo queue. You can send this message to either an edit control or a rich edit control.
To send this message, call the SendMessage function with the following parameters.
SendMessage(
(HWND) hWnd, // handle to destination window
EM_UNDO, // message to send
(WPARAM) wParam, // not used; must be zero
(LPARAM) lParam // not used; must be zero
);
Parameters
This message has no parameters.
Return Values
For a single-line edit control, the return value is always TRUE.
For a multiline edit control, the return value is TRUE if the undo operation is successful, or FALSE if the undo operation fails.
Remarks
Edit controls and Rich Edit 1.0: An undo operation can also be undone. For example, you can restore deleted text with the first EM_UNDO message, and remove the text again with a second EM_UNDO message as long as there is no intervening edit operation.
Rich Edit 2.0 and later: The undo feature is multilevel—so sending two EM_UNDO messages will undo the last two operations in the undo queue. To redo an operation, send the EM_REDO message.
Rich Edit: For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Version: Requires Rich Edit 1.0 or later.
Header: Declared in Winuser.h; include Windows.h.
*/