// Write the clipboard in VC and copy the data to the clipboard
Void cclipboarddlg: onbutton1 ()
{
// Todo: add your control notification handler code here
Updatedata ();
Cstring source = m_strclipborad;
// Save the text content in the source variable
If (openclipboard ())
{
Hglobal clipbuffer;
Char * buffer;
Emptyclipboard ();
Clipbuffer = globalalloc (gmem_ddeshare, source. getlength () + 1 );
Buffer = (char *) globallock (clipbuffer );
Strcpy (buffer, lpcstr (source ));
Globalunlock (clipbuffer );
Setclipboarddata (cf_text, clipbuffer );
Closeclipboard ();
}
}
// Read the clipboard in VC and read the data in the clipboard
Void cclipboarddlg: onbutton2 ()
{
// Todo: add your control notification handler code here
Char * buffer = NULL;
// Open the clipboard
Cstring fromclipboard;
If (openclipboard ())
{
Handle hdata = getclipboarddata (cf_text );
Char * buffer = (char *) globallock (hdata );
Fromclipboard = buffer;
Globalunlock (hdata );
Closeclipboard ();
}
M_strclipborad + = fromclipboard;
Updatedata (false );
}
Http://download1.csdn.net/down3/20070603/03093334376.rar