// 复制到剪切板
if ( !OpenClipboard() )
{
AfxMessageBox( "Cannot open the Clipboard" );
return;
}
EmptyClipboard();
CString strText;
m_machineText.GetWindowText(strText);
HGLOBAL h = GlobalAlloc(LMEM_FIXED|LMEM_ZEROINIT,100);
LPBYTE lpData = (LPBYTE)GlobalLock(h);
memcpy(lpData, strText.GetBuffer(), strText.GetLength()+1);
GlobalUnlock(h);
SetClipboardData(CF_TEXT, h);
CloseClipboard();
剪切板功能
最新推荐文章于 2024-06-12 17:32:25 发布