添加自定义的三个全局函数GetShellFolderViewDual、XZSHOpenFolderAndSelectItems和FindTarget,注意它们的先后顺序,用的时候使用如下方式就行了:
--------------------------------------------
CString strFileName="c://readme.txt";
FindTarget(strFileName);
--------------------------------------------
HRESULT GetShellFolderViewDual(ITEMIDLIST* pidl, IShellFolderViewDual** ppIShellFolderViewDual)
{
IWebBrowserApp* pIWebBrowserApp;
IDispatch* pDoc;
HWND hWnd;
HRESULT hr;
HINSTANCE ghSHDOCVW;
HRESULT (WINAPI*gpfSHGetIDispatchForFolder)(ITEMIDLIST* pidl, IWebBrowserApp** ppIWebBrowserApp);
*ppIShellFolderViewDual = NULL;
ghSHDOCVW = LoadLibrary(_T("SHDOCVW.DLL"));
if (ghSHDOCVW == NULL)
return FALSE;
pIWebBrowserApp=NULL;
gpfSHGetIDispatchForFolder = (HRESULT (WINAPI*)(ITEMIDLIST*, IWebBrowserApp**)) GetProcAddress(ghSHDOCVW, "SHGetIDispa