You may copy the data to the clipboard by calling the SetClipboardData function. Then you can get the data from the clipboard by calling the GetClipboardData function. For more detailed information about Clipboard functions APIs please see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win32/unila
yer_4qgj.asp
added a sample code:
CBitmap *pBmp
void CMyDlg::OnCopyButton ()
{
if (!OpenClipboard())
return;
EmptyClipboard();
SetClipboardData(CF_BITMAP, pBmp ->GetSafeHandle());
CloseClipboard();
}
void CMyDlg::OnPasteButton()
{
if (!IsClipboardFormatAvailable(CF_BITMAP))
return;
if (!OpenClipboard())
return;
HANDLE handle = GetClipboardData(CF_BITMAP);
if (handle != NULL)
{
delete bmp;
pBmp = CBitmap::FromHandle((HBITMAP)handle);
EmptyClipboard();
} CloseClipboard();
}
For more information about these functions, please see: