BOOL CFilteringDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
m_vDir1 = m_Dir1.GetControlUnknown();
// Displays all physical drives
// To avoid duplicate loading, use AutoInitialLoad = False in
// property page
m_vDir1->ControlStyle = styleSftDirectoryComboBoxDetailList;
m_vDir1->TopMostFolderSpecial = specialSftDirectoryMyComputer;
m_vDir1->Headers->Style = headersSftDirectoryButton;
m_vDir1->Column[contentsSftDirectoryName]->HeaderText = "Drives";
return TRUE;
}
void CFilteringDlg::OnFilteringSftDirectory1(LPDISPATCH FAR* Folder, BOOL FAR* RemoveFolder)
{
ISftDirectoryFolderPtr pFolder(*Folder);
// This filters out folders such as "Shared Documents", "Control Panel", which
// are part of "My Computer"
if (pFolder->Type >= typeSftDirectory_Computer_Drive35 && pFolder->Type <= typeSftDirectory_Computer_Other)
; // OK, add this to the control contents
else
*RemoveFolder = VARIANT_TRUE; // don't add this to the control contents
}
BEGIN_EVENTSINK_MAP(CFilteringDlg, CDialog)
//{{AFX_EVENTSINK_MAP(CFilteringDlg)
ON_EVENT(CFilteringDlg, IDC_SFTDIRECTORY1, 5 /* Filtering */, OnFilteringSftDirectory1, VTS_PDISPATCH VTS_PBOOL)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()