在编辑框(CEdit)控件上追加内容

// MFC 版本 CEdit* pEdit = GetDlgItem(IDC_EDIT1); ASSERT(pEdit && pEdit->GetSafeHwnd()); pEdit->SetSel(-1); pEdit->ReplaceSel(_T("Hello, World!")); // SDK 版本 HWND hEdit = ::GetDlgItem(hWnd, IDC_EDIT1); ASSERT(hEdit); ::SendMessage(hEdit, EM_SETSEL, LOWORD(-1), HIWORD(-1)); ::SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)(_T("Hello, World!")));

你可能感兴趣的:(mfc)