Advertisement
2002C System Services/ Functions #15890

Send a string to the clipboard

Without using OLE... Michael Pickens mfc_faq@stingray.com

AI

Yapay Zeka Özeti: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kaynak Kod
original-source
CString str = "Some text";
::OpenClipboard(this->m_hWnd);
::EmptyClipboard();
HGLOBAL h = GlobalAlloc(GHND | GMEM_SHARE, str.GetLength() + 1);
strcpy((LPSTR)GlobalLock(h), str);
GlobalUnlock(h);
::SetClipboardData(CF_TEXT, h);
::CloseClipboard(); 
Orijinal Yorumlar (3)
Wayback Machine'den kurtarıldı