1 // MFCExplorerDlg.cpp : implementation file
6 #include "MFCExplorerDlg.h"
11 static char THIS_FILE[] = __FILE__;
14 /////////////////////////////////////////////////////////////////////////////
15 // CMFCExplorerDlg dialog
18 CMFCExplorerDlg::CMFCExplorerDlg(LPCTSTR pszPath,CWnd* pParent /*=NULL*/)
19 : CDialog(CMFCExplorerDlg::IDD, pParent)
21 //{{AFX_DATA_INIT(CMFCExplorerDlg)
22 // NOTE: the ClassWizard will add member initialization here
29 void CMFCExplorerDlg::DoDataExchange(CDataExchange* pDX)
31 CDialog::DoDataExchange(pDX);
32 //{{AFX_DATA_MAP(CMFCExplorerDlg)
33 DDX_Control(pDX, IDC_TREE_SHELL, m_tcShell);
34 DDX_Control(pDX, IDC_LIST_SHELL, m_lcShell);
35 DDX_Control(pDX, IDC_COMBO_SHELL, m_cbShell);
40 BEGIN_MESSAGE_MAP(CMFCExplorerDlg, CDialog)
41 //{{AFX_MSG_MAP(CMFCExplorerDlg)
42 ON_BN_CLICKED(IDC_MFC_BUTT_DETAILS, OnMfcButtDetails)
43 ON_BN_CLICKED(IDC_MFC_BUTT_LARGE_ICONS, OnMfcButtLargeIcons)
44 ON_BN_CLICKED(IDC_MFC_BUTT_REPORT, OnMfcButtReport)
45 ON_BN_CLICKED(IDC_MFC_BUTT_SMALL_ICONS, OnMfcButtSmallIcons)
49 /////////////////////////////////////////////////////////////////////////////
50 // CMFCExplorerDlg message handlers
52 void CMFCExplorerDlg::OnMfcButtDetails()
54 // TODO: Add your control notification handler code here
55 m_lcShell.SetViewType(LVS_LIST);
58 void CMFCExplorerDlg::OnMfcButtLargeIcons()
60 // TODO: Add your control notification handler code here
61 m_lcShell.SetViewType(LVS_ICON);
64 void CMFCExplorerDlg::OnMfcButtReport()
66 // TODO: Add your control notification handler code here
67 m_lcShell.SetViewType(LVS_REPORT);
70 void CMFCExplorerDlg::OnMfcButtSmallIcons()
72 // TODO: Add your control notification handler code here
73 m_lcShell.SetViewType(LVS_SMALLICON);
76 BOOL CMFCExplorerDlg::OnInitDialog()
78 CDialog::OnInitDialog();
80 // TODO: Add extra initialization here
81 m_cbShell.SetTreeCtrlWnd(m_tcShell.GetSafeHwnd());
82 m_tcShell.SetListCtrlWnd(m_lcShell.GetSafeHwnd());
83 m_tcShell.SetComboBoxWnd(m_cbShell.GetSafeHwnd());
84 m_tcShell.LoadFolderItems(m_sPath);
86 return TRUE; // return TRUE unless you set the focus to a control
87 // EXCEPTION: OCX Property Pages should return FALSE