On one of my property sheets I have two CMFCEditBrowseCtrl objects.
One of them is for selecting a local folder on the computer. So I have used the following style in OnInitDialog:
m_BrowseLocalBackupFolder.EnableFolderBrowseButton(nullptr, BIF_NEWDIALOGSTYLE);
The popup window when browsing for the folder looks like this:
My other control uses my own class CRemoteFTPFolderSelect which is derived from the CMFCEditBrowseCtrl. This is because I need to display a remote folder listing via FTP. I am using FluentFTP via my C# DLL wrapper to achieve this. My OnBrowse method:
void CRemoteFTPFolderSelect::OnBrowse()
{
if (theApp.MSAToolsInterface().ConnectToFTP(m_strHostname, m_strUsername, m_strPassword))
{
CBrowseFolderFTP dlgBrowse(this);
CString strRemoteBackupFolder;
GetWindowText(strRemoteBackupFolder);
if (strRemoteBackupFolder != _T(""))
dlgBrowse.SetSelectedFolder(strRemoteBackupFolder);
if (dlgBrowse.DoModal() == IDOK)
{
dlgBrowse.GetSelectedFolder(strRemoteBackupFolder);
SetWindowText(strRemoteBackupFolder);
CMFCPropertyPage* pParent = (CMFCPropertyPage*)GetParent();
if (pParent)
{
CWnd* pWnd = pParent->GetDlgItem(IDC_BUTTON_APPLY);
if (pWnd != nullptr)
pWnd->EnableWindow(TRUE);
}
}
theApp.MSAToolsInterface().DisconnectFromFTP();
}
}
I have had to use my own dialog resource and at the moment it looks like this:
At the moment I am creating the image list like this:
SHGetFileInfo(
_T("Doesn't matter"),
FILE_ATTRIBUTE_DIRECTORY,
&sfi, sizeof sfi,
SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);
m_imgList.Add(sfi.hIcon);
SHGetFileInfo(
_T("Doesn't matter"),
FILE_ATTRIBUTE_DIRECTORY,
&sfi, sizeof sfi,
SHGFI_ICON | SHGFI_OPENICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);
m_imgList.Add(sfi.hIcon);
m_treeFTP.SetImageList(&m_imgList, TVSIL_NORMAL );
Is it possible to get icons similar to those used by the m_BrowseLocalBackupFolder.EnableFolderBrowseButton(nullptr, BIF_NEWDIALOGSTYLE) browse window for the + / - images?

