-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFolderDialog.cpp
More file actions
42 lines (32 loc) · 857 Bytes
/
Copy pathFolderDialog.cpp
File metadata and controls
42 lines (32 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// FolderDialog.cpp: implementation of the FolderDialog class.
//
//////////////////////////////////////////////////////////////////////
#include "FolderDialog.h"
#include <shlobj.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
FolderDialog::FolderDialog()
{
}
FolderDialog::~FolderDialog()
{
}
UINT FolderDialog::Show(HWND hOwner, LPTSTR strTitle, LPTSTR strDirectory)
{
BROWSEINFO bi;
ITEMIDLIST *pidl;
bi.hwndOwner = hOwner;
bi.pidlRoot = 0;
bi.pszDisplayName = strDirectory;
bi.lpszTitle = strTitle;
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = 0;
bi.lParam = 0;
pidl = SHBrowseForFolder(&bi);
if (SHGetPathFromIDList(pidl, strDirectory))
{
return TRUE;
}
return FALSE;
}