CString strTemp = L"中国CHINA";
if(OpenClipboard())
{
HGLOBAL clipbuffer;
TCHAR * buffer;
EmptyClipboard();
clipbuffer = GlobalAlloc(GHND | GMEM_SHARE, (strTemp.GetLength()+1)*sizeof(TCHAR));
buffer = (TCHAR*)GlobalLock(clipbuffer);
lstrcpy(buffer, strTemp);
GlobalUnlock(clipbuffer);
SetClipboardData(CF_UNICODETEXT,clipbuffer);
CloseClipboard();
}
阅读(921) | 评论(0) | 转发(0) |