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 // IEShellTreeView.cpp : implementation file
21 #include "UIMessages.h"
22 #include "IEShellTreeView.h"
27 static char THIS_FILE[] = __FILE__;
30 /////////////////////////////////////////////////////////////////////////////
33 IMPLEMENT_DYNCREATE(CIEShellTreeView,CUITreeView)
35 CIEShellTreeView::CIEShellTreeView()
36 : CUITreeView(IDC_TREE_SHELL)
42 CIEShellTreeView::~CIEShellTreeView()
46 LPTVITEMDATA CIEShellTreeView::GetSelectedItemData()
48 HTREEITEM hItem = GetShellTreeCtrl().GetSelectedItem();
49 LPTVITEMDATA ptvid=NULL;
51 ptvid = (LPTVITEMDATA)GetShellTreeCtrl().GetItemData(hItem);
55 void CIEShellTreeView::OnInitialUpdate()
57 CUITreeView::OnInitialUpdate();
59 // TODO: Add your specialized code here and/or call the base class
62 GetShellTreeCtrl().SetComboBoxWnd(GetParentFrame()->GetSafeHwnd());
67 bool CIEShellTreeView::PopulateTree(LPCTSTR pszPath)
69 CIEShellTreeCtrl *pCtrl = (CIEShellTreeCtrl*)m_pTreeCtrl;
70 m_bPopulated = pCtrl->LoadFolderItems(pszPath);
74 void CIEShellTreeView::CreateTreeCtrl()
76 // TODO: Add your specialized code here and/or call the base class
77 m_pTreeCtrl = new CIEShellTreeCtrl;
80 BEGIN_MESSAGE_MAP(CIEShellTreeView, CUITreeView)
81 //{{AFX_MSG_MAP(CIEShellTreeView)
82 ON_MESSAGE(WM_SETMESSAGESTRING,OnSetmessagestring)
83 // NOTE - the ClassWizard will add and remove mapping macros here.
87 /////////////////////////////////////////////////////////////////////////////
88 // CIEShellTreeView message handlers
90 void CIEShellTreeView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
92 if (bActivate && pDeactiveView != NULL)
94 // theApp.SwitchTab(CViewTabView::TAB_LIST_FOLDER);
95 GetTreeCtrl().SetFocus();
97 CView::OnActivateView(bActivate, pActivateView, pDeactiveView);
101 LRESULT CIEShellTreeView::OnSetmessagestring(WPARAM wParam, LPARAM lParam)
103 CFrameWnd *pFrame = GetParentFrame();
105 return pFrame->SendMessage(WM_SETMESSAGESTRING,wParam,lParam);