2 * Copyright 2003 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 struct ShellBrowserChild
: public ChildWindow
, public IShellBrowserImpl
34 typedef ChildWindow super
;
36 ShellBrowserChild(HWND hwnd
, const ShellChildWndInfo
& info
);
39 static ShellBrowserChild
* create(HWND hmdiclient
, const FileChildWndInfo
& info
)
42 ChildWindow
* child
= ChildWindow::create(hmdiclient
, info
._pos
.rcNormalPosition
,
43 WINDOW_CREATOR_INFO(ShellBrowserChild
,ShellChildWndInfo
), CLASSNAME_CHILDWND
, NULL
, &info
);
45 //TODO: SDI implementation
48 ShowWindow(*child
, info
._pos
.showCmd
);
50 return static_cast<ShellBrowserChild
*>(child
);
54 STDMETHOD(GetWindow
)(HWND
* lphwnd
)
61 STDMETHOD(QueryActiveShellView
)(IShellView
** ppshv
)
63 _pShellView
->AddRef();
68 STDMETHOD(GetControlWindow
)(UINT id
, HWND
* lphwnd
)
78 HWND hwnd
= (HWND
)SendMessage(_hWndFrame
, PM_GET_CONTROLWINDOW
, id
, 0);
88 STDMETHOD(SendControlMsg
)(UINT id
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
, LRESULT
* pret
)
93 HWND hstatusbar
= (HWND
)SendMessage(_hWndFrame
, PM_GET_CONTROLWINDOW
, id
, 0);
96 *pret
= ::SendMessage(hstatusbar
, uMsg
, wParam
, lParam
);
106 WindowHandle _hWndFrame
;
107 ShellChildWndInfo _create_info
;
110 IShellView
* _pShellView
; // current hosted shellview
111 HIMAGELIST _himlSmall
; // list
112 // HIMAGELIST _himlLarge; // shell image
113 TreeDropTarget
* _pDropTarget
;
117 LRESULT
WndProc(UINT nmsg
, WPARAM wparam
, LPARAM lparam
);
118 int Notify(int id
, NMHDR
* pnmh
);
120 LRESULT
Init(LPCREATESTRUCT
);
121 void InitializeTree(/*const FileChildWndInfo& info*/);
122 int InsertSubitems(HTREEITEM hParentItem
, Entry
* entry
, IShellFolder
* pParentFolder
);
125 HRESULT
OnDefaultCommand(LPIDA pIDList
);
127 void OnTreeGetDispInfo(int idCtrl
, LPNMHDR pnmh
);
128 void OnTreeItemExpanding(int idCtrl
, LPNMTREEVIEW pnmtv
);
129 void OnTreeItemRClick(int idCtrl
, LPNMHDR pnmh
);
130 void OnTreeItemSelected(int idCtrl
, LPNMTREEVIEW pnmtv
);
132 void UpdateFolderView(IShellFolder
* folder
);
133 void Tree_DoItemMenu(HWND hwndTreeView
, HTREEITEM hItem
, LPPOINT pptScreen
);
134 bool expand_folder(ShellDirectory
* entry
);