DirTreeCtrl.h
上传用户:shouhua
上传日期:2014-12-06
资源大小:5685k
文件大小:2k
- #if !defined(AFX_DIRTREECTRL_H__50417455_89CA_4507_BC23_DAC8244BAFE6__INCLUDED_)
- #define AFX_DIRTREECTRL_H__50417455_89CA_4507_BC23_DAC8244BAFE6__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // DirTreeCtrl.h : header file
- //
- #include "MyList.h"
- /////////////////////////////////////////////////////////////////////////////
- // CDirTreeCtrl window
- class CDirTreeCtrl : public CTreeCtrl
- {
- // Construction
- public:
- CDirTreeCtrl();
- MyList *m_list;
- // Attributes
- public:
- CString m_strFullPath;
- // Operations
- public:
- void Initialize (MyList *list);
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CDirTreeCtrl)
- //}}AFX_VIRTUAL
- // Implementation
- public:
- bool SetFolder (CString path);
- CString GetFullPath (HTREEITEM item);
- virtual ~CDirTreeCtrl();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CDirTreeCtrl)
- afx_msg void OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- private:
- HTREEITEM DirToItem(HTREEITEM current, char *dir);
- CString GetPathFromHere (CString s, HTREEITEM itm);
- HTREEITEM InsertItems (const char *name, HTREEITEM parent, bool isDir, int icon, int iconOpen);
- void ExpandBranch (HTREEITEM parent);
- void DeleteAllChild (HTREEITEM itm, bool isEmpty=true);
- HTREEITEM AddItem(const char * path, HTREEITEM parent, bool isDir=FALSE, int iconEx=-1, int iconEx2=-1);
-
- HTREEITEM m_DesktopRoot;//desktop_root;
- CString m_DesktopPath;
- HTREEITEM m_DrivesRoot;
- char m_DrivesName[512];
- CImageList m_ImageList;
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_DIRTREECTRL_H__50417455_89CA_4507_BC23_DAC8244BAFE6__INCLUDED_)