• 大小: 87.9 KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-09-22
  • 语言: 其他
  • 标签:

资源简介

基于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个文件信息

评论

共有 条评论

相关资源