void 置剪辑版文本(CString 要复制的数据){ if (::OpenClipboard(NULL)) { ::EmptyClipboard(); HGLOBAL clipbuffer; char* buffer; size_t nDataLenth = (要复制的数据.GetLength() + 1) * 2; clipbuffer = ::GlobalAlloc(GMEM_DDESHARE, (要复制的数据.GetLength() + 1) * 2); buffer = (char*)::GlobalLock(clipbuffer); memcpy(buffer, (char*)要复制的数据.GetBuffer(), nDataLenth); ::GlobalUnlock(clipbuffer); UINT nFormat = (sizeof(TCHAR) == sizeof(WCHAR) ? CF_UNICODETEXT : CF_TEXT); ::SetClipboardData(nFormat, clipbuffer); ::CloseClipboard(); } }