Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++

C++
<pre lang="c++">
Hello,
please suggest how to get the network drives in the dialog box list along with the local hard disk names.please suggest the suitable API or some code in C++.
Thank You
Posted

1 solution

C++
BROWSEINFO   bi; 
ZeroMemory(&bi,   sizeof(bi)); 

bi.hwndOwner        =   NULL; 
bi.pidlRoot         =   NULL; 
bi.lpszTitle        =   _T("Please select a folder:"); 
bi.ulFlags          =   BIF_RETURNONLYFSDIRS;
bi.lParam           =   NULL; 
bi.iImage           =   0;  

LPITEMIDLIST   pidl   =   SHBrowseForFolder(&bi);
TCHAR   szPathName[MAX_PATH]; 
if   (NULL   !=   pidl)
{
	BOOL bRet = SHGetPathFromIDList(pidl,szPathName);
        if(FALSE == bRet)
	{
              return;
	}
         AfxMessageBox(szPathName);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900