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 #ifndef __IESHELLTREECTRL_H__
19 #define __IESHELLTREECTRL_H__
23 #endif // _MSC_VER > 1000
28 // IEShellTreeCtrl.h : header file
31 #include "IEFolderTreeCtrl.h"
32 #include "IEShellDragDrop.h"
33 /////////////////////////////////////////////////////////////////////////////
34 // CIEShellTreeCtrl window
36 class CTRL_EXT_CLASS CIEShellTreeCtrl : public CIEFolderTreeCtrl
44 void SetNotifyParent(bool bNotifyParent) { m_bNotifyParent = bNotifyParent; }
45 bool RefreshAllowed() { return m_bRefreshAllowed; }
46 void SetRefreshAllowed(bool bRefresh) { m_bRefreshAllowed = bRefresh; }
47 void SetListCtrlWnd(HWND hWnd) { m_hListWnd = hWnd; }
48 void SetComboBoxWnd(HWND hWnd) { m_hComboWnd = hWnd; }
49 CString GetSelectedPath() { return GetPathName(); }
52 virtual void UpOneLevel(HTREEITEM hItem=NULL);
53 virtual void ShellExecute(HTREEITEM hItem,LPCTSTR pszVerb=NULL);
54 virtual void SetNotificationObject(bool bNotify);
55 virtual bool LoadFolderItems(LPCTSTR pszPath=NULL);
56 virtual bool GetFolderInfo(HTREEITEM hItem,CString &sPath,CString &sName);
57 virtual void Refresh();
58 virtual HTREEITEM FindPidl(LPITEMIDLIST pidlAbs,BOOL bSelect=TRUE);
59 virtual HTREEITEM ExpandPidl(LPITEMIDLIST pidlAbs);
60 virtual HTREEITEM ExpandMyComputer(LPITEMIDLIST pidlAbs);
63 virtual void RefreshComboBox(LPTVITEMDATA lptvid);
64 virtual void DestroyThreads();
65 virtual void CreateFileChangeThreads(HWND hwnd);
66 virtual void CreateFileChangeThread (const CString& sPath,HWND hwnd);
67 virtual HTREEITEM SearchSiblings(HTREEITEM hItem,LPITEMIDLIST pidlAbs);
68 virtual HTREEITEM FindItem(HTREEITEM hItem, const CString& strTarget);
69 virtual UINT DeleteChildren(HTREEITEM hItem);
70 virtual bool SHMoveFile(HTREEITEM hSrcItem,HTREEITEM hDestItem);
71 // ClassWizard generated virtual function overrides
72 //{{AFX_VIRTUAL(CIEShellTreeCtrl)
73 virtual BOOL OnWndMsg( UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult );
74 virtual bool Expanding(NM_TREEVIEW *nmtvw);
75 virtual CRefresh *CreateRefreshObject(HTREEITEM hItem,LPARAM lParam);
76 virtual DROPEFFECT DoDragDrop(NM_TREEVIEW* pNMTreeView,COleDataSource *pOleDataSource);
77 virtual bool EndLabelEdit(HTREEITEM hItem,LPCTSTR pszText);
78 virtual BOOL TransferItem(HTREEITEM hitemDrag, HTREEITEM hitemDrop);
81 virtual void ShowProperties(HTREEITEM hItem);
82 virtual void ShowPopupMenu(HTREEITEM hItem,CPoint point);
83 virtual void DoubleClick(HTREEITEM hItem);
84 virtual void DeleteKey(HTREEITEM hItem);
85 virtual void GoBack(HTREEITEM hItem);
86 virtual void PreSubclassWindow();
87 virtual void UpdateEvent(LPARAM lHint,CObject *pHint);
88 virtual bool DragDrop(CDD_OleDropTargetInfo *pInfo);
89 virtual bool DragOver(CDD_OleDropTargetInfo *pInfo);
90 virtual bool DragEnter(CDD_OleDropTargetInfo *pInfo);
91 virtual bool DragLeave(CDD_OleDropTargetInfo *pInfo);
95 virtual ~CIEShellTreeCtrl();
97 // Generated message map functions
99 //{{AFX_MSG(CIEShellTreeCtrl)
100 // NOTE - the ClassWizard will add and remove member functions here.
101 afx_msg BOOL OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
102 afx_msg void OnDestroy();
103 afx_msg LRESULT OnAppDirChangeEvent(WPARAM wParam, LPARAM lParam);
104 afx_msg LRESULT OnCBIESelChange(WPARAM wParam,LPARAM lParam);
105 afx_msg LRESULT OnAppPopulateTree(WPARAM wParam, LPARAM lParam );
106 afx_msg LRESULT OnAppCbIeHitEnter(WPARAM wParam, LPARAM lParam );
107 afx_msg LRESULT OnSetmessagestring(WPARAM wParam, LPARAM lParam );
109 DECLARE_MESSAGE_MAP()
111 enum { MAX_THREADS=32 };
112 static UINT ThreadFunc (LPVOID pParam);
113 LPTVITEMDATA m_lptvid;
114 HANDLE m_hThreads[MAX_THREADS];
115 CWinThread *m_pThreads[MAX_THREADS];
116 CEvent m_event[MAX_THREADS];
118 bool m_bRefreshAllowed;
119 bool m_bNotifyParent;
120 CIEShellDragDrop m_ShellDragDrop;
125 /////////////////////////////////////////////////////////////////////////////
126 typedef struct DC_THREADINFO
129 CIEShellTreeCtrl *pTreeCtrl;
131 } DC_THREADINFO, *PDC_THREADINFO;
134 //{{AFX_INSERT_LOCATION}}
135 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
137 #endif //__IESHELLTREECTRL_H__