2 * Copyright 2003, 2004 Martin Fuchs
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 // Martin Fuchs, 23.07.2003
28 #include "../utility/treedroptarget.h"
29 #include "../utility/shellbrowserimpl.h"
32 /// Implementation of IShellBrowserImpl interface in explorer child windows
33 struct ShellBrowserChild
: public ChildWindow
, public IShellBrowserImpl
35 typedef ChildWindow super
;
37 ShellBrowserChild(HWND hwnd
, const ShellChildWndInfo
& info
);
40 static ShellBrowserChild
* create(const FileChildWndInfo
& info
)
43 ChildWindow
* child
= ChildWindow::create(info
, info
._pos
.rcNormalPosition
,
44 WINDOW_CREATOR_INFO(ShellBrowserChild
,ShellChildWndInfo
), CLASSNAME_CHILDWND
, NULL
, info
._pos
.showCmd
==SW_SHOWMAXIMIZED
? WS_MAXIMIZE
: 0);
46 ///@todo SDI implementation
49 return static_cast<ShellBrowserChild
*>(child
);
53 virtual HRESULT STDMETHODCALLTYPE
GetWindow(HWND
* lphwnd
)
60 virtual HRESULT STDMETHODCALLTYPE
QueryActiveShellView(IShellView
** ppshv
)
62 _pShellView
->AddRef();
67 virtual HRESULT STDMETHODCALLTYPE
GetControlWindow(UINT id
, HWND
* lphwnd
)
77 HWND hwnd
= (HWND
)SendMessage(_hWndFrame
, PM_GET_CONTROLWINDOW
, id
, 0);
87 virtual HRESULT STDMETHODCALLTYPE
SendControlMsg(UINT id
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
, LRESULT
* pret
)
92 HWND hstatusbar
= (HWND
)SendMessage(_hWndFrame
, PM_GET_CONTROLWINDOW
, id
, 0);
95 *pret
= ::SendMessage(hstatusbar
, uMsg
, wParam
, lParam
);
102 const Root
& get_root() const {return _root
;}
107 WindowHandle _hWndFrame
;
108 ShellChildWndInfo _create_info
;
111 IShellView
* _pShellView
; // current hosted shellview
112 HIMAGELIST _himlSmall
; // list
113 // HIMAGELIST _himlLarge; // shell image
114 TreeDropTarget
* _pDropTarget
;
118 LRESULT
WndProc(UINT nmsg
, WPARAM wparam
, LPARAM lparam
);
119 int Notify(int id
, NMHDR
* pnmh
);
121 LRESULT
Init(LPCREATESTRUCT
);
122 void InitializeTree(/*const FileChildWndInfo& info*/);
123 int InsertSubitems(HTREEITEM hParentItem
, Entry
* entry
, IShellFolder
* pParentFolder
);
126 virtual String
jump_to_int(LPCTSTR url
);
127 bool jump_to_pidl(LPCITEMIDLIST pidl
);
129 HRESULT
OnDefaultCommand(LPIDA pida
);
131 void OnTreeGetDispInfo(int idCtrl
, LPNMHDR pnmh
);
132 void OnTreeItemExpanding(int idCtrl
, LPNMTREEVIEW pnmtv
);
133 void OnTreeItemRClick(int idCtrl
, LPNMHDR pnmh
);
134 void OnTreeItemSelected(int idCtrl
, LPNMTREEVIEW pnmtv
);
136 void UpdateFolderView(IShellFolder
* folder
);
137 void Tree_DoItemMenu(HWND hwndTreeView
, HTREEITEM hItem
, LPPOINT pptScreen
);
138 HTREEITEM
select_entry(HTREEITEM hitem
, Entry
* entry
, bool expand
=true);