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 //*******************************************************************************
19 #if !defined(AFX_IESHELLCOMBOBOX_H__1EABA279_32DD_4A2D_8957_F478E4D3E5EB__INCLUDED_)
20 #define AFX_IESHELLCOMBOBOX_H__1EABA279_32DD_4A2D_8957_F478E4D3E5EB__INCLUDED_
24 #endif // _MSC_VER > 1000
25 // IEShellComboBox.h : header file
27 #include "ShellContextMenu.h"
28 #include "ShellPidl.h"
31 ////////////////////////////////////////////////
32 // CIEShellComboBoxEdit
33 ////////////////////////////////////////////////
34 class CIEShellComboBoxEdit : public CEdit
37 CIEShellComboBoxEdit();
38 virtual ~CIEShellComboBoxEdit();
41 CString &GetText() { GetWindowText(m_sText); return m_sText; }
42 void SetTreeWnd(HWND hWnd);
43 virtual BOOL PreTranslateMessage(MSG* pMsg);
50 inline CIEShellComboBoxEdit::CIEShellComboBoxEdit()
55 inline CIEShellComboBoxEdit::~CIEShellComboBoxEdit()
60 inline void CIEShellComboBoxEdit::SetTreeWnd(HWND hWnd)
65 /////////////////////////////////////////////////////////////////////////////
66 // CIEShellComboBox window
68 class CTRL_EXT_CLASS CIEShellComboBox : public CComboBoxEx
76 CShellPidl &GetShellPidl() { return m_ShellPidl; }
77 LPITEMIDLIST GetSelectedPidl();
78 void SetTreeCtrlWnd(HWND hWnd) { m_hTreeWnd = hWnd; }
81 void Populate(LPITEMIDLIST pidlAbsSel=NULL);
83 void BuildFolderList(LPSHELLFOLDER pFolder,LPITEMIDLIST pidl,LPITEMIDLIST pidlAbsSel,int nIndent);
84 void InitItems(LPITEMIDLIST pidlAbsSel);
85 void LoadItems(LPITEMIDLIST pidlAbsSel);
86 void LoadURLPrevList();
87 void SetShellImageList();
88 int AddItem(const CShCMSort *pItem);
89 void DeleteItemData(LPTVITEMDATA pItemData);
90 void DeleteAllItemData();
91 void AddItems(vecCMSort &vItems,IShellFolder* pFolder,LPITEMIDLIST pidlAbs,int nIndent);
92 void AddFolder(vecCMSort &vItems,const SHFILEINFO &FileInfo,LPITEMIDLIST pidlAbs,LPITEMIDLIST pidl,LPSHELLFOLDER pFolder,int nIndent);
93 void SelectionChanged(bool bEnter=false);
96 // ClassWizard generated virtual function overrides
97 //{{AFX_VIRTUAL(CIEShellComboBox)
99 virtual void PreSubclassWindow();
104 virtual ~CIEShellComboBox();
106 // Generated message map functions
108 //{{AFX_MSG(CIEShellComboBox)
109 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
110 afx_msg void OnDestroy();
111 afx_msg void OnKillFocus(CWnd *pNewWnd);
112 afx_msg void OnSetFocus(CWnd *pWnd);
113 afx_msg void OnDropDown();
114 afx_msg void OnSelChange();
115 afx_msg LRESULT OnCBIEPopulate(WPARAM wParam,LPARAM lParam);
116 afx_msg LRESULT OnAppCbIeHitEnter(WPARAM wParam, LPARAM lParam );
119 DECLARE_MESSAGE_MAP()
122 LPITEMIDLIST m_pidlMyComputer;
123 LPITEMIDLIST m_pidlMyDocuments;
124 LPITEMIDLIST m_pidlInternet;
125 CShellPidl m_ShellPidl;
126 vecItemData m_vecItemData;
128 HIMAGELIST m_hImageList;
129 CImageList m_ImageList;
132 CIEShellComboBoxEdit m_cbEdit;
137 /////////////////////////////////////////////////////////////////////////////
139 //{{AFX_INSERT_LOCATION}}
140 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
142 #endif // !defined(AFX_IESHELLCOMBOBOX_H__1EABA279_32DD_4A2D_8957_F478E4D3E5EB__INCLUDED_)