GetNetPath

来源:互联网 发布:兄弟连it教育 学费 编辑:程序博客网 时间:2024/06/06 10:03

BROWSEINFO bi;
 wchar_t Dir[100]={0};
 ITEMIDLIST *pidl; 

 

 CString cstrRoot = _T("////192.168.1.99//Music//");
 PIDLIST_ABSOLUTE* ppidl = new PIDLIST_ABSOLUTE;
 DWORD dwVal;

 SHILCreateFromPath(cstrRoot.GetBuffer(),&(*ppidl),&dwVal);


 bi.hwndOwner = NULL; 
 bi.pidlRoot = *ppidl;  //设定默认路径
 bi.pszDisplayName = _T("123"); 
 bi.lpszTitle = _T("选择一个目录"); 
 bi.ulFlags = BIF_RETURNONLYFSDIRS; 
 bi.lpfn = NULL; 
 bi.lParam = 0; 
 bi.iImage = 0; 

 pidl = SHBrowseForFolder( &bi );             /* Display "Select Folde
             r" dialog box, Get the  
             folder name and co
             nvert it into a ITEMLIST  
             data structure. */


 if ( pidl == NULL ) 
  Dir[0] = 0; 

 if (!SHGetPathFromIDList( pidl, Dir ))       /* Retrieve folder name
             from ITEMLIST structure. */ 
             Dir[0] = 0;

原创粉丝点击