📄 hdirectorytree.h
字号:
#if !defined(AFX_DIRECTRYTREE_H__520C1701_CCE0_432A_9F6E_A296E32E7EE3__INCLUDED_)
#define AFX_DIRECTRYTREE_H__520C1701_CCE0_432A_9F6E_A296E32E7EE3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DirectryTree.h : header file
//
#include <direct.h>
#include <afxtempl.h>
#include "HPublic.h"
/////////////////////////////////////////////////////////////////////////////
// CHDirectoryTree window
#define UM_EXPAND_TREE WM_USER+1100
#define UM_CLICK_TREE_ITEM WM_USER+1101
#define UM_FIND_NEW_FILE WM_USER+1102
#define UM_BEGIN_FILE WM_USER+1103
#define UM_SEL_FILE WM_USER+1104
class AFX_EXT_CLASS HDriverInfo{
public:
HDriverInfo(){m_bCurDriver=0;};
virtual ~HDriverInfo(){};
CString m_strDriver;
CString m_strLable;
int m_nType;
BOOL m_bCurDriver;
void operator=(HDriverInfo &other){
m_strDriver=other.m_strDriver;
m_strLable=other.m_strLable;
m_nType=other.m_nType;
m_bCurDriver=other.m_bCurDriver;
}
};
typedef AFX_EXT_CLASS CArray<HDriverInfo,HDriverInfo&> HDrivers;
class AFX_EXT_CLASS CHDirectoryTree : public CTreeCtrl,CHPublic
{
// Construction
public:
CHDirectoryTree();
// Attributes
public:
private:
BOOL m_bInit;
HTREEITEM m_hRoot0;
// Operations
public:
void SeeckFolders(HTREEITEM hSelItem);
BOOL CHDirectoryTree::GetLongPathName(LPTSTR lpszShortPath, LPTSTR lpszLongPath);
static CString CHDirectoryTree::GetLongPathName(CString strShortPathName);
private:
CString GetURL(HTREEITEM hItem);
void SendToList(WIN32_FIND_DATA WFD);
BOOL FillChildrenOf(HTREEITEM hItem);
void GetDrivers(HDrivers& Drivers);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHDirectoryTree)
protected:
//}}AFX_VIRTUAL
// Implementation
public:
HTREEITEM GetItemByPath(CString strURL="");
void AddItemsWithInitURL(CString strInitURL);
HTREEITEM GetChildItemByText(HTREEITEM hParent,CString strText);
void InitTree(CString strBeginURL="");
void SeekDrivers();
virtual ~CHDirectoryTree();
// Generated message map functions
protected:
void AddItems(HTREEITEM hSelItem=NULL,CString strBeginURL="");
//{{AFX_MSG(CHDirectoryTree)
afx_msg void OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIRECTRYTREE_H__520C1701_CCE0_432A_9F6E_A296E32E7EE3__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -