修改文本可以这样: CWindow wnd;
wnd.Attach(CTest::GetDlgItem(IDC_BUTTON1));
wnd.SetWindowText(_T("New"));但如果我要对控件做一些专门的处理呢?
比如说列表框的清空,添加
wnd.Attach(CTest::GetDlgItem(IDC_BUTTON1));
wnd.SetWindowText(_T("New"));但如果我要对控件做一些专门的处理呢?
比如说列表框的清空,添加
lParam
Pointer to the null-terminated string that is to be added.
If you create the list box with an owner-drawn style but without the LBS_HASSTRINGS style, this parameter is stored as item data instead of the string to which it would otherwise point. You can send the LB_GETITEMDATA and LB_SETITEMDATA messages to retrieve or modify the item data.
hwnd = GetDlgItem(IDC_BUTTON1);
LPCTSTR lpsz;
lpsz = "OK";
SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)lpsz);
是可行的如果是比较麻烦的处理呢?