新建一个对话框工程;
双击按钮,让你输入单击的成员函数名称,然后进入代码编辑;
void CJieqieDlg::OnButton1()
{
// TODO: Add your control notification handler code here
if( !OpenClipboard() )
{
AfxMessageBox( _T("Cannot open the Clipboard!") );
return;
}
if( !EmptyClipboard() )
{
AfxMessageBox( _T("Cannot empty the Clipboard!") );
return;
}
// 取回当前控件的数据,hData开辟全局内存区域,存放数据
CString str;
this->GetDlgItemText( IDC_EDIT1, str );
size_t cbStr = (str.GetLength()+1)*sizeof(TCHAR);
HGLOBAL hData = G