SHBrowseForFolder 用法
1 char path[500];
2 BROWSEINFO br;
3 ITEMIDLIST *item;
4 br.hwndOwner = this->GetSafeHwnd();
5 br.iImage = 0;
6 br.pszDisplayName = 0;
7 br.lParam = 0;
8 br.lpfn = 0;
9 br.lpszTitle = "请选择路径:";
10 br.pidlRoot = 0;
11 br.ulFlags = BIF_RETURNONLYFSDIRS|BIF_USENEWUI|BIF_BROWSEINCLUDEFILES;
12 item = SHBrowseForFolder(&br);
13
14 if( item!= NULL ) //Non-CANCEL
15 {
16 if (SHGetPathFromIDList(item,path)==TRUE)
17 {
18 }
19 }
20
2 BROWSEINFO br;
3 ITEMIDLIST *item;
4 br.hwndOwner = this->GetSafeHwnd();
5 br.iImage = 0;
6 br.pszDisplayName = 0;
7 br.lParam = 0;
8 br.lpfn = 0;
9 br.lpszTitle = "请选择路径:";
10 br.pidlRoot = 0;
11 br.ulFlags = BIF_RETURNONLYFSDIRS|BIF_USENEWUI|BIF_BROWSEINCLUDEFILES;
12 item = SHBrowseForFolder(&br);
13
14 if( item!= NULL ) //Non-CANCEL
15 {
16 if (SHGetPathFromIDList(item,path)==TRUE)
17 {
18 }
19 }
20