要实现用户自定义浏览文件夹(不是目录选择,是用户提供文件夹绝对路径),我使用如下方法,但是我该如何得到pidl呢? IShellBrowser* m_pSB=GetShellBrowser();
m_pSB->BrowseObject(pidl,SBSP_SAMEBROWSER|SBSP_DEFMODE );
m_pSB->BrowseObject(pidl,SBSP_SAMEBROWSER|SBSP_DEFMODE );
IBindCtx *pbc,
LPITEMIDLIST *ppidl,
SFGAOF sfgaoIn,
SFGAOF *psfgaoOut
);
//IDesktopFolder::ParseDisplayName()方法得到ID
SHGetDesktopFolder(IDesktopFolder);
IDesktopFolder.ParseDisplayName(Handle, NULL, vFileName, Eaten, vItemIDList, Flags);
[Now Supported on Windows NT]Converts an item identifier list to a file system path.WINSHELLAPI BOOL WINAPI SHGetPathFromIDList( LPCITEMIDLIST pidl,
LPSTR pszPath
);
ParameterspidlPointer to an item identifier list that specifies a file or directory location relative to the root of the name space (the desktop).pszPathPointer to a buffer that receives the file system path. The size of this buffer is assumed to be MAX_PATH bytes. Return ValuesReturns TRUE if successful or FALSE if an error occurs ?for example, if the location specified by the pidl parameter is not part of the file system.