CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);int index = pEdit->GetWindowTextLength(); pEdit->SetSel(index, index);pEdit->ReplaceSel(str);
SetWindowText("");就可以清空了