if (OpenClipboard()){
CString temp;
GetDlgItemText(IDC_EDIT1, temp);
EmptyClipboard();
HGLOBAL hmem=NULL;
hmem = GlobalAlloc(GHND, (1+temp.GetLength())*sizeof(CString));
wchar_t *lps;
lps= (wchar_t *)GlobalLock(hmem);
wchar_t *tempc;
tempc = temp.GetBuffer(0);
temp.ReleaseBuffer();
wcscpy_s(lps, (wcslen(tempc)+1)*sizeof(wchar_t), tempc);
GlobalUnlock(hmem);
SetClipboardData(CF_UNICODETEXT, hmem);
DWORD dw=GetLastError();
CloseClipboard();
MessageBox(L"复制成功");