資源簡介
基于MFC的文件目錄樹的對話框實現代碼,可以生成本地磁盤的文件樹形目錄,不錯的對話框控件哦。
代碼片段和文件信息
//?DlgGetPath.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“getPath.h“
#include?“DlgGetPath.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CAboutDlg?dialog?used?for?App?About
class?CAboutDlg?:?public?CDialog
{
public:
CAboutDlg();
//?Dialog?Data
//{{AFX_DATA(CAboutDlg)
enum?{?IDD?=?IDD_ABOUTBOX?};
//}}AFX_DATA
//?ClassWizard?generated?virtual?function?overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual?void?DoDataExchange(CDataExchange*?pDX);????//?DDX/DDV?support
//}}AFX_VIRTUAL
//?Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg()?:?CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void?CAboutDlg::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg?CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
//?No?message?handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//Handy?local?functions.
TCHAR* MakeobjectDynamic(?LPTSTR?szData?);
CString?WindowName(?CString?sName?);
bool ParsePath(?CString?sPath?int?nLevel?CString?*const?psDirName?);
#define?NETWORK_NEIGHBOUR???_T(“Network?Neighborhood“)
/////////////////////////////////////////////////////////////////////////////
//?CDlgGetPath?dialog
CDlgGetPath::CDlgGetPath(CWnd*?pParent?/*=NULL*/)
:?CDialog(CDlgGetPath::IDD?pParent)
{
//{{AFX_DATA_INIT(CDlgGetPath)
//?NOTE:?the?ClassWizard?will?add?member?initialization?here
//}}AFX_DATA_INIT
//?Note?that?LoadIcon?does?not?require?a?subsequent?DestroyIcon?in?Win32
m_hIcon?=?AfxGetApp()->LoadIcon(IDR_MAINframe);
}
void?CDlgGetPath::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgGetPath)
DDX_Control(pDX?IDC_TREE?m_Tree);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgGetPath?CDialog)
//{{AFX_MSG_MAP(CDlgGetPath)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_NOTIFY(TVN_SELCHANGED?IDC_TREE?OnSelchangedTree)
ON_NOTIFY(TVN_ITEMEXPANDING?IDC_TREE?OnItemexpandingTree)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CDlgGetPath?message?handlers
BOOL?CDlgGetPath::OnInitDialog()
{
CDialog::OnInitDialog();
//?Add?“About...“?menu?item?to?system?menu.
//?IDM_ABOUTBOX?must?be?in?the?system?command?range.
ASSERT((IDM_ABOUTBOX?&?0xFFF0)?==?IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX?0xF000);
CMenu*?pSysMenu?=?GetSystemMenu(FALSE);
if?(pSysMenu?!=?NULL)
{
CString?strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if?(!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->Ap
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????118874??2009-03-04?11:24??PathPicker_src\Debug\TryNetworkTree.exe
?????目錄??????????0??2009-03-05?17:29??PathPicker_src\Debug
?????文件??????18308??2009-03-04?11:22??PathPicker_src\DlgGetPath.cpp
?????文件???????2004??2000-09-06?14:41??PathPicker_src\DlgGetPath.h
?????文件???????3577??2000-09-07?09:58??PathPicker_src\DlgTryNetworkTree.cpp
?????文件???????1374??2000-09-06?16:13??PathPicker_src\DlgTryNetworkTree.h
?????文件???????2166??2000-09-06?13:55??PathPicker_src\res\filetypes.bmp
????..A.SH.??????6144??2009-03-05?17:29??PathPicker_src\res\Thumbs.db
?????文件???????1078??2000-09-06?13:11??PathPicker_src\res\TryNetworkTree.ico
?????文件????????407??2000-09-06?16:13??PathPicker_src\res\TryNetworkTree.rc2
?????目錄??????????0??2009-03-05?17:29??PathPicker_src\res
?????文件????????781??2000-09-06?16:14??PathPicker_src\resource.h
?????文件????????216??2000-09-06?16:11??PathPicker_src\StdAfx.cpp
?????文件???????1058??2000-09-06?14:30??PathPicker_src\StdAfx.h
?????文件??????23172??2009-03-04?10:32??PathPicker_src\TryNetworkTree.aps
?????文件???????2142??2000-09-06?16:11??PathPicker_src\TryNetworkTree.cpp
?????文件???????4552??2009-03-04?18:04??PathPicker_src\TryNetworkTree.dsp
?????文件????????536??2009-03-04?10:31??PathPicker_src\TryNetworkTree.dsw
?????文件???????1412??2000-09-06?16:12??PathPicker_src\TryNetworkTree.h
?????文件??????58368??2009-03-05?17:29??PathPicker_src\TryNetworkTree.ncb
?????文件??????55808??2009-03-05?17:29??PathPicker_src\TryNetworkTree.opt
?????文件????????262??2009-03-05?16:07??PathPicker_src\TryNetworkTree.plg
?????文件???????5904??2000-09-06?16:21??PathPicker_src\TryNetworkTree.rc
?????目錄??????????0??2009-03-05?17:29??PathPicker_src
?????文件?????118860??2009-03-05?17:29??getPath\Debug\getPath.exe
?????目錄??????????0??2009-03-05?17:30??getPath\Debug
?????文件??????16140??2009-03-05?17:29??getPath\DlgGetPath.cpp
?????文件???????1969??2009-03-05?17:23??getPath\DlgGetPath.h
?????文件??????37952??2009-03-05?17:21??getPath\getPath.aps
?????文件???????1170??2009-03-05?17:29??getPath\getPath.clw
............此處省略20個文件信息
評論
共有 條評論