粘贴图片至RichEditCtl

来源:互联网 发布:斧子科技 知乎 编辑:程序博客网 时间:2024/04/30 21:47
void CDlgPaper::OnClickedButtonPasteSpecial()
{
 // TODO: Add your control notification handler code here

 UINT nFormat;
 int nIndex;
 DVASPECT das;
 HGLOBAL hg;
 COlePasteSpecialDialog dlg(PSF_SELECTPASTE, NULL, this);

 dlg.AddStandardFormats(FALSE);
 if (dlg.DoModal() == IDOK) {
  nIndex = dlg.GetPasteIndex();
  nFormat = dlg.m_ps.arrPasteEntries[nIndex].fmtetc.cfFormat;
  das = dlg.GetDrawAspect();
  hg = dlg.GetIconicMetafile();
  m_editPaperText.PasteSpecial(nFormat, das, (HMETAFILE) hg);
 }

}

-----------

原创粉丝点击