}
//这就是CopyCallback方法,拷贝钩子的所有功能由它实现。参数的具体值参看MSDN
UINT __stdcall CCopyHook::CopyCallback(HWND hwnd,UINT wFunc,UINT wFlags,
LPCTSTR pszSrcFile,DWORD dwSrcAttribs,
LPCTSTR pszDestFile,DWORD dwDestAttribs){
char szMessage[MAX_PATH+14];
sprintf(szMessage,"对%s进行的操作,是否继续?",pszSrcFile);
return MessageBox(NULL,szMessage,"确认",MB_YESNO|MB_ICONEXCLAMATION);
}
ULONG __stdcall CClassFactory::AddRef(){
if(m_refcnt==0)
nLocks++;
m_refcnt++;
return m_refcnt;
}
ULONG __stdcall CClassFactory::Release(){
int nNewCnt=--m_refcnt;
if(nNewCnt<=0){
nLocks--;
delete this;
}
return nNewCnt;
}
HRESULT __stdcall CClassFactory::QueryInterface(REFIID iid,void** ppvObject){
if(iid==IID_IUnknown)
*ppvObject=static_cast<IUnknown*>(this);
else
if(iid==IID_IClassFactory)
&