wavelength 1.0.0
Loading...
Searching...
No Matches
FolderDialog.h
Go to the documentation of this file.
1#pragma once
2
3#include <afxwin.h>
4
5#include <shlobj.h>
6
14public:
23 CFolderDialog(LPCTSTR initialFolder, UINT flags, CWnd *parent);
24
26 virtual ~CFolderDialog();
27
34 virtual int DoModal();
35
43
44protected:
50 virtual void OnInitialized();
51
58 virtual void OnSelChanged(LPITEMIDLIST pidl);
59
68 virtual void OnBrowseMessage(HWND hwnd, UINT msg, LPARAM lParam);
69
76 void EnableOK(BOOL enable);
77
84 void SetSelection(LPCTSTR path);
85
92 void SetSelection(LPCITEMIDLIST pidl);
93
100 void SetStatusText(LPCTSTR text);
101
109 CString ShortenPath(const CString &path);
110
111private:
122 static int CALLBACK BrowseCallbackProc(HWND hwnd, UINT msg, LPARAM lParam, LPARAM lpData);
123
124 BROWSEINFO mBrowseInfo;
125 CString mInitialFolder;
126 CString mSelectedFolder;
127 TCHAR mDisplayName[MAX_PATH];
128 TCHAR mPath[MAX_PATH];
129 HWND mWnd;
130};
void EnableOK(BOOL enable)
Enable or disable the OK button.
CFolderDialog(LPCTSTR initialFolder, UINT flags, CWnd *parent)
Prepare the dialogue.
virtual void OnSelChanged(LPITEMIDLIST pidl)
Record a new selection.
virtual int DoModal()
Show the dialogue.
void SetSelection(LPCTSTR path)
Select a folder by path.
void SetStatusText(LPCTSTR text)
Show text above the folder tree.
void SetSelection(LPCITEMIDLIST pidl)
Select a folder by item.
virtual void OnBrowseMessage(HWND hwnd, UINT msg, LPARAM lParam)
Dispatch a message from the dialogue.
virtual void OnInitialized()
Select the initial folder once the dialogue is open.
virtual ~CFolderDialog()
CString GetSelectedFolder()
Report the chosen folder, or the initial folder when none was chosen.
CString ShortenPath(const CString &path)
Shorten a path to fit the status text: its first 35 characters and an ellipsis.