zoukankan      html  css  js  c++  java
  • 拖拽文件到RichEdit的后期处理

    当然肯定是要实现IRichEditOleCallback这个接口,网上很多文章有这个介绍,


    HRESULT STDMETHODCALLTYPE TRichEditOleCallback::QueryAcceptData(LPDATAOBJECT lpdataobj, CLIPFORMAT FAR *lpcfFormat,
    												  DWORD reco, BOOL fReally, HGLOBAL hMetaPict)
    {
    	HRESULT result=S_OK;
    	if (TRUE==fReally)
    	{
    
    		FORMATETC tFormat={ 0xC007/*FileNameW*/, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
    		STGMEDIUM tSTGMEDIUM;
    		ZeroMemory(&tSTGMEDIUM,  sizeof(STGMEDIUM));
    		if (S_OK==lpdataobj->GetData(&tFormat,&tSTGMEDIUM))
    		{
    
    			LPOLESTR pstrData =(LPOLESTR)GlobalLock(tSTGMEDIUM.lpszFileName); //GlobalLock(tSTGMEDIUM.lpszFileName);
    			/*
    			USES_CONVERSION;  
    			CString strFileName =OLE2T(pstrData);
    			HYPERLINKINFO linkInfo;
    			NMHDR header;
    			header.hwndFrom = m_RichEditCtrl->m_hWnd ;
    			header.idFrom   = m_RichEditCtrl->GetDlgCtrlID();
    			header.code     = 0xFFFF;
    			m_RichEditCtrl->GetParent()->SendMessage(WM_NOTIFY,(WPARAM)strFileName.GetBuffer(0),(LPARAM)&header);
    			*/
    			GlobalUnlock(tSTGMEDIUM.lpszFileName);	
    			ReleaseStgMedium(&tSTGMEDIUM);
    			return S_FALSE;
    		}
    	}
    	return S_OK;
    }


  • 相关阅读:
    Git 基本操作
    Git 基础
    MarkDown教程
    Python常用函数
    Python生成器
    Python列表生成式
    Python迭代
    Python切片
    Python函数
    Python不可变对象
  • 原文地址:https://www.cnblogs.com/cl1024cl/p/6204796.html
Copyright © 2011-2022 走看看