如何向RICHEDIT控件发消息

来源:百度知道 编辑:UC知道 时间:2024/06/05 06:12:57
如何用SendMessage给RICHEDIT控件里添加字符或数字。

发送消息WM_SETTEXT,lParam指定字符串

lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) WM_SETTEXT, // message ID (WPARAM) wParam, // = (WPARAM) () wParam; (LPARAM) lParam // = (LPARAM) () lParam; );
Parameters

wParam
This parameter is not used.
lParam
Pointer to a null-terminated string that is the window text.

GetDlgItem(你edit的id)->SetWindowText("内容");
内容也可用cstring取代
如果要输入数字,可以用format
CString a;
int b;
a.Format("%d",b);