Advertisement
2002ASP System Services/ Functions #7286

Send a string to the clipboard

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

AI

Resumen de IA: 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.

Código fuente
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(); 
Comentarios originales (3)
Recuperado de Wayback Machine