1 //*******************************************************************************
4 // You may use this source code, compile or redistribute it as part of your application
5 // for free. You cannot redistribute it as a part of a software development
6 // library without the agreement of the author. If the sources are
7 // distributed along with the application, you should leave the original
8 // copyright notes in the source code without any changes.
9 // This code can be used WITHOUT ANY WARRANTIES at your own risk.
11 // For the latest updates to this code, check this site:
12 // http://www.masmex.com
15 // Copyright(C) 2000 Philip Oldaker <email: philip@masmex.com>
16 //*******************************************************************************
18 #if !defined(AFX_IEFOLDERTREECTRL_H__9743E545_1F3A_11D2_A40D_9CB186000000__INCLUDED_)
19 #define AFX_IEFOLDERTREECTRL_H__9743E545_1F3A_11D2_A40D_9CB186000000__INCLUDED_
23 #endif // _MSC_VER >= 1000
24 // IEFolderTreeCtrl.h : header file
26 #include "ShellPidl.h"
27 #include "ShellSettings.h"
29 #include "UITreeCtrl.h"
30 /////////////////////////////////////////////////////////////////////////////
31 // CIEFolderTreeCtrl window
34 class CTRL_EXT_CLASS CIEFolderTreeCtrl : public CUITreeCtrl
42 CShellPidl &GetShellPidl();
43 CString GetRootPath();
44 void SetRootPath(const CString &sPath);
45 const CShellSettings &GetShellSettings() const;
46 CShellSettings &GetShellSettings();
47 virtual LPCITEMIDLIST GetPathPidl(HTREEITEM hItem);
48 virtual CString GetPathName(HTREEITEM hItem=NULL);
52 virtual void Sort(HTREEITEM hParent,LPSHELLFOLDER pFolder);
53 virtual void Refresh();
55 virtual LPSHELLFOLDER GetItemFolder(HTREEITEM hItem);
56 virtual HTREEITEM AddFolder(HTREEITEM hItem,LPITEMIDLIST pidl,LPSHELLFOLDER pFolder);
57 virtual HTREEITEM AddFolder(HTREEITEM hItem,LPCTSTR pszPath);
58 virtual bool LoadItems(LPCTSTR pszPath=NULL,DWORD dwFolderType=0);
59 virtual bool AddItems(HTREEITEM hItem,IShellFolder* pFolder);
60 virtual void OnDeleteItemData(DWORD dwData);
61 virtual void SetButtonState(HTREEITEM hItem);
62 virtual void RefreshNode(HTREEITEM hItem);
63 virtual void SetAttributes(HTREEITEM hItem,LPSHELLFOLDER pFolder,LPITEMIDLIST pidl);
66 // ClassWizard generated virtual function overrides
67 //{{AFX_VIRTUAL(CIEFolderTreeCtrl)
71 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
72 virtual void CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType = adjustBorder);
74 virtual BOOL LoadURL(HTREEITEM hItem);
78 virtual ~CIEFolderTreeCtrl();
80 // Generated message map functions
82 static int CALLBACK CompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
83 //{{AFX_MSG(CIEFolderTreeCtrl)
84 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
85 afx_msg void OnDeleteItem(NMHDR* pNMHDR, LRESULT* pResult);
86 afx_msg LRESULT OnSettingChange(WPARAM wParam,LPARAM lParam);
87 afx_msg void OnDestroy();
93 CShellPidl m_ShellPidl;
95 HIMAGELIST m_hImageList;
96 CShellSettings m_ShellSettings;
99 inline const CShellSettings &CIEFolderTreeCtrl::GetShellSettings() const
101 return m_ShellSettings;
104 inline CShellSettings &CIEFolderTreeCtrl::GetShellSettings()
106 return m_ShellSettings;
109 inline CString CIEFolderTreeCtrl::GetRootPath()
114 inline void CIEFolderTreeCtrl::SetRootPath(const CString &sPath)
119 inline CShellPidl &CIEFolderTreeCtrl::GetShellPidl()
123 /////////////////////////////////////////////////////////////////////////////
125 //{{AFX_INSERT_LOCATION}}
126 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
128 #endif // !defined(AFX_IEFOLDERTREECTRL_H__9743E545_1F3A_11D2_A40D_9CB186000000__INCLUDED_)