修改文本可以这样: CWindow wnd;
wnd.Attach(CTest::GetDlgItem(IDC_BUTTON1));
wnd.SetWindowText(_T("New"));但如果我要对控件做一些专门的处理呢?
比如说列表框的清空,添加

解决方案 »

  1.   

    lResult = SendMessage(      // returns LRESULT in lResult     (HWND) hWndControl,      // handle to destination control     (UINT) LB_ADDSTRING,      // message ID     (WPARAM) wParam,      // = (WPARAM) () wParam;    (LPARAM) lParam      // = (LPARAM) () lParam; );  
    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.
      

  2.   

    HWND hwnd;
    hwnd = GetDlgItem(IDC_BUTTON1);
    LPCTSTR lpsz;
    lpsz = "OK";
    SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)lpsz);
    是可行的如果是比较麻烦的处理呢?
      

  3.   

    刚发现用ATL比Active control简单点,现在又改WTL?