vc打开目录对话框

vc打开目录对话框

 _TCHAR buf[MAX_PATH],buf2[MAX_PATH];

 BROWSEINFO brinfo;
 brinfo.hwndOwner = m_hWnd;
 brinfo.pidlRoot = NULL;
 brinfo.pszDisplayName = buf;
 brinfo.lpszTitle = _T("选择大智慧新一代安装根目录");
 brinfo.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
 brinfo.lpfn = NULL;
 brinfo.lParam = NULL;

 LPCITEMIDLIST pidl = SHBrowseForFolder(&brinfo);   //   do   it  

 if( pidl == NULL )
  return;

 SHGetPathFromIDList( pidl, buf2 );
 
 SetDlgItemText(IDC_EDIT_DZHINSTALLDIR, buf2);

你可能感兴趣的:(vc打开目录对话框)