ReactOS 0.4.16-dev-197-g92996da
shellbrowser.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2003, 2004, 2005, 2006 Martin Fuchs
3 *
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.
8 *
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.
13 *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19
20 //
21 // Explorer clone
22 //
23 // shellbrowser.cpp
24 //
25 // Martin Fuchs, 23.07.2003
26 //
27
28
29#include <precomp.h>
30
31 // work around GCC's wide string constant bug
32#ifdef __GNUC__
34#endif
35
36ShellBrowser::ShellBrowser(HWND hwnd, HWND hwndFrame, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info,
38 : super(IID_IShellFolderViewCB),
39 _hwnd(hwnd),
40 _hwndFrame(hwndFrame),
41 _left_hwnd(left_hwnd),
42 _right_hwnd(right_hwnd),
43 _create_info(create_info),
44 _callback(cb),
45 _cm_ifs(cm_ifs)
46{
49 _last_sel = 0;
50
51 _cur_dir = NULL;
52
53 HDC hDC = GetDC(NULL);
54 if (hDC)
55 {
58
59 DWORD ilMask;
60 if (bpp <= 4)
61 ilMask = ILC_COLOR4;
62 else if (bpp <= 8)
63 ilMask = ILC_COLOR8;
64 else if (bpp <= 16)
65 ilMask = ILC_COLOR16;
66 else if (bpp <= 24)
67 ilMask = ILC_COLOR24;
68 else if (bpp <= 32)
69 ilMask = ILC_COLOR32;
70 else
71 ilMask = ILC_COLOR;
72
73 ilMask |= ILC_MASK;
74
77 }
78}
79
81{
84
85 if (_pShellView)
87
88 if (_pDropTarget) {
91 }
92
93 if (_right_hwnd) {
95 _right_hwnd = 0;
96 }
97}
98
99
101{
102 CONTEXT("ShellBrowser::Init()");
103
104 const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR);
105
106 _root._drive_type = DRIVE_UNKNOWN;
107 lstrcpy(_root._volname, root_name);
108 _root._fs_flags = 0;
109 lstrcpy(_root._fs, TEXT("Desktop"));
110
112
113 _root._entry->read_directory(SCAN_DONT_ACCESS|SCAN_NO_FILESYSTEM); // avoid to handle desktop root folder as file system directory
114
115 if (_left_hwnd) {
117 InitDragDrop();
118 }
119
121
122 /* already filled by ShellDirectory constructor
123 lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */
124}
125
127{
128 Entry* entry = NULL;
129
130 if (!_cur_dir)
131 _cur_dir = static_cast<ShellDirectory*>(_root._entry);
132
133 //LOG(FmtString(TEXT("ShellBrowser::jump_to(): pidl=%s"), (LPCTSTR)FileSysShellPath(pidl)));
134
135 // We could call read_tree() here to iterate through the hierarchy and open all folders
136 // from _create_info._root_shell_path (_cur_dir) to _create_info._shell_path (pidl).
137 // To make it easier we just use ILFindChild() instead.
138 if (_cur_dir) {
139 static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILFindChild(TEXT("SHELL32"), 24);
140
141 if (ILFindChild) {
142 for(;;) {
143 LPCITEMIDLIST child_pidl = (*ILFindChild)(_cur_dir->create_absolute_pidl(), pidl);
144 if (!child_pidl || !child_pidl->mkid.cb)
145 break;
146
148
149 entry = _cur_dir->find_entry(child_pidl);
150 if (!entry)
151 break;
152
153 _cur_dir = static_cast<ShellDirectory*>(entry);
155 }
156 } else {
158
159 entry = _cur_dir->find_entry(pidl); // This is not correct in the common case, but works on the desktop level.
160
161 if (entry) {
162 _cur_dir = static_cast<ShellDirectory*>(entry);
164 }
165 }
166 }
167
168 // If not already called, now directly call UpdateFolderView() using pidl
169 if (!entry)
171}
172
173
175{
176 CONTEXT("ShellBrowserChild::InitializeTree()");
177
180
181 TV_INSERTSTRUCT tvInsert;
182 TV_ITEM& tvItem = tvInsert.item;
183
184 tvInsert.hParent = 0;
185 tvInsert.hInsertAfter = TVI_LAST;
186
188 tvItem.lParam = (LPARAM)_root._entry;
189 tvItem.pszText = _root._volname; //LPSTR_TEXTCALLBACK;
190 tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
191 tvItem.cChildren = 1;
192
196}
197
199{
200 CONTEXT("ShellBrowser::InitDragDrop()");
201
203
204 if (!_pDropTarget)
205 return false;
206
208
209 if (FAILED(RegisterDragDrop(_left_hwnd, _pDropTarget))) {//calls addref
210 _pDropTarget->Release(); // free TreeDropTarget
212 return false;
213 } else
215
216 FORMATETC ftetc;
217
218 ftetc.dwAspect = DVASPECT_CONTENT;
219 ftetc.lindex = -1;
220 ftetc.tymed = TYMED_HGLOBAL;
221 ftetc.cfFormat = CF_HDROP;
222
224
225 return true;
226}
227
228
230{
231 CONTEXT("ShellBrowser::OnTreeGetDispInfo()");
232
233 LPNMTVDISPINFO lpdi = (LPNMTVDISPINFO)pnmh;
234 ShellEntry* entry = (ShellEntry*)lpdi->item.lParam;
235
236 if (entry) {
237 if (lpdi->item.mask & TVIF_TEXT)
238 lpdi->item.pszText = entry->_display_name;
239
240 if (lpdi->item.mask & (TVIF_IMAGE|TVIF_SELECTEDIMAGE)) {
241 if (lpdi->item.mask & TVIF_IMAGE)
242 lpdi->item.iImage = get_image_idx(
243 entry->safe_extract_icon((ICONCACHE_FLAGS)(ICF_HICON|ICF_OVERLAYS)));
244
245 if (lpdi->item.mask & TVIF_SELECTEDIMAGE)
246 lpdi->item.iSelectedImage = get_image_idx(
247 entry->safe_extract_icon((ICONCACHE_FLAGS)(ICF_HICON|ICF_OVERLAYS|ICF_OPEN)));
248 }
249 }
250}
251
253{
254 if (icon_id != ICID_NONE) {
256
257 if (found != _image_map.end())
258 return found->second;
259
261
262 _image_map[icon_id] = idx;
263
264 return idx;
265 } else
266 return -1;
267}
268
270{
273
276
278
281
283}
284
285
287{
288 CONTEXT("ShellBrowser::OnTreeItemExpanding()");
289
290 if (pnmtv->action == TVE_COLLAPSE)
292 else if (pnmtv->action == TVE_EXPAND) {
294
295 if (entry)
296 if (!InsertSubitems(pnmtv->itemNew.hItem, entry, entry->_folder)) {
297 entry->_shell_attribs &= ~SFGAO_HASSUBFOLDER;
298
299 // remove subitem "+"
300 TV_ITEM tvItem;
301
302 tvItem.mask = TVIF_CHILDREN;
303 tvItem.hItem = pnmtv->itemNew.hItem;
304 tvItem.cChildren = 0;
305
307 }
308 }
309}
310
312{
313 CONTEXT("ShellBrowser::InsertSubitems()");
314
315 WaitCursor wait;
316
317 int cnt = 0;
318
320
321 try {
322 entry->smart_scan(SORT_NAME, SCAN_DONT_ACCESS);
323 } catch(COMException& e) {
325 }
326
327 // remove old children items
328 HTREEITEM hchild, hnext;
329
330 hnext = TreeView_GetChild(_left_hwnd, hParentItem);
331
332 while((hchild=hnext) != 0) {
333 hnext = TreeView_GetNextSibling(_left_hwnd, hchild);
335 }
336
337 TV_ITEM tvItem;
338 TV_INSERTSTRUCT tvInsert;
339
340 for(entry=entry->_down; entry; entry=entry->_next) {
341#ifndef _LEFT_FILES
342 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
343#endif
344 {
345 // ignore hidden directories
346 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
347 continue;
348
349 // ignore directory entries "." and ".."
350 if (entry->_data.cFileName[0]==TEXT('.') &&
351 (entry->_data.cFileName[1]==TEXT('\0') ||
352 (entry->_data.cFileName[1]==TEXT('.') && entry->_data.cFileName[2]==TEXT('\0'))))
353 continue;
354
355 ZeroMemory(&tvItem, sizeof(tvItem));
356
358 tvItem.pszText = LPSTR_TEXTCALLBACK;
359 tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
360 tvItem.lParam = (LPARAM)entry;
361 tvItem.cChildren = entry->_shell_attribs & SFGAO_HASSUBFOLDER? 1: 0;
362
363 if (entry->_shell_attribs & SFGAO_SHARE) {
364 tvItem.mask |= TVIF_STATE;
365 tvItem.stateMask |= TVIS_OVERLAYMASK;
366 tvItem.state |= INDEXTOOVERLAYMASK(1);
367 }
368
369 tvInsert.item = tvItem;
370 tvInsert.hInsertAfter = TVI_LAST;
371 tvInsert.hParent = hParentItem;
372
374
375 ++cnt;
376 }
377 }
378
380
381 return cnt;
382}
383
384
386{
387 CONTEXT("ShellBrowser::OnTreeItemSelected()");
388
389 Entry* entry = (Entry*)pnmtv->itemNew.lParam;
390
391 _last_sel = pnmtv->itemNew.hItem;
392
393 if (entry)
395}
396
397
399{
400 CONTEXT("ShellBrowser::OnTreeItemRClick()");
401
402 TVHITTESTINFO tvhti;
403
404 GetCursorPos(&tvhti.pt);
406
407 tvhti.flags = LVHT_NOWHERE;
409
410 if (TVHT_ONITEM & tvhti.flags) {
411 LPARAM itemData = TreeView_GetItemData(_left_hwnd, tvhti.hItem);
412
413 if (itemData) {
414 Entry* entry = (Entry*)itemData;
416
417 HRESULT hr = entry->do_context_menu(_hwnd, tvhti.pt, _cm_ifs);
418
419 if (SUCCEEDED(hr))
420 refresh();
421 else
422 CHECKERROR(hr);
423 }
424 }
425}
426
427
429{
430 CONTEXT("ShellBrowser::UpdateFolderView()");
431
433 IShellView* pLastShellView = _pShellView;
434
435 _folder = folder;
436
437 if (pLastShellView)
438 pLastShellView->GetCurrentInfo(&fs);
439 else {
442 }
443
444 SFV_CREATE sfv_create;
445
446 sfv_create.cbSize = sizeof(SFV_CREATE);
447 sfv_create.pshf = folder;
448 sfv_create.psvOuter = NULL;
449 sfv_create.psfvcb = this;
450
452
453 if (FAILED(hr)) {
455 return;
456 }
457
459 hr = _pShellView->CreateViewWindow(pLastShellView, &fs, static_cast<IShellBrowser*>(this), &rect, &_right_hwnd/*&m_hWndListView*/);
460
461 if (pLastShellView) {
462 pLastShellView->GetCurrentInfo(&fs);
463 pLastShellView->UIActivate(SVUIA_DEACTIVATE);
464 pLastShellView->DestroyViewWindow();
465 pLastShellView->Release();
466 }
467
468 _pShellView->UIActivate(SVUIA_ACTIVATE_NOFOCUS);
469}
470
473{
474 if (uMsg == SFVM_INITMENUPOPUP) {
476 InsertMenu((HMENU)lParam, 0, MF_BYPOSITION, 12345, TEXT("TEST ENTRY"));
477 return S_OK;
478 }
479
480 return E_NOTIMPL;
481}
482
483
485{
486 CONTEXT("ShellBrowser::OnDefaultCommand()");
487
488 if (pida->cidl >= 1) {
489 if (_left_hwnd) { // explorer mode
490 if (_last_sel) {
492
493 if (parent) {
494 try {
495 parent->smart_scan(SORT_NAME, SCAN_DONT_ACCESS);
496 } catch(COMException& e) {
497 return e.Error();
498 }
499
500 UINT firstOffset = pida->aoffset[1];
501 LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset);
502
503 Entry* entry = parent->find_entry(pidl);
504
505 if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
506 if (entry->_etype == ET_SHELL)
508 return S_OK;
509
511 return E_NOTIMPL;
512 }
513 }
514 } else { // no tree control
516 return S_OK;
517
518/* create new Frame Window
519 if (MainFrame::OpenShellFolders(pida, 0))
520 return S_OK;
521*/
522 }
523 }
524
525 return E_NOTIMPL;
526}
527
528
530{
531 CONTEXT("ShellBrowser::select_entry()");
532
534 return 0;
535
536 for(hitem=TreeView_GetChild(_left_hwnd,hitem); hitem; hitem=TreeView_GetNextSibling(_left_hwnd,hitem)) {
537 if ((Entry*)TreeView_GetItemData(_left_hwnd,hitem) == entry) {
538 if (TreeView_SelectItem(_left_hwnd, hitem)) {
539 if (expand)
541
542 return hitem;
543 }
544
545 break;
546 }
547 }
548
549 return 0;
550}
551
552
554{
555 if (!_root._entry)
556 return false;
557
558 // iterate through the hierarchy and open all folders to reach pidl
559 WaitCursor wait;
560
562 Entry* entry = _root._entry;
563
564 for(const void*p=pidl;;) {
565 if (!p)
566 return true;
567
568 if (!entry || !hitem)
569 break;
570
571 entry->smart_scan(SORT_NAME, SCAN_DONT_ACCESS);
572
573 Entry* found = entry->find_entry(p);
574 p = entry->get_next_path_component(p);
575
576 if (found)
577 hitem = select_entry(hitem, found);
578
579 entry = found;
580 }
581
582 return false;
583}
584
586{
587 HWND hwnd;
588
589 /* TranslateAccelerator is called for all explorer windows that are open
590 so we have to decide if this is the correct recipient */
591 hwnd = lpmsg->hwnd;
592
593 while(hwnd)
594 {
595 if(hwnd == _hwnd)
596 break;
597
599 }
600
601 if (hwnd)
602 return _pShellView->TranslateAccelerator(lpmsg) == S_OK;
603
604 return false;
605}
606
608{
609 CONTEXT("ShellBrowser::expand_folder()");
610
611 if (!_last_sel)
612 return false;
613
615 return false;
616
619 if (TreeView_SelectItem(_left_hwnd, hitem)) {
620 if (expand)
622 return false;
623
624 return true;
625 }
626
627 break;
628 }
629 }
630
631 return false;
632}
633
634
636{
638}
639
640
641#ifndef _NO_MDI
642
644 : super(hwnd, info),
645 _create_info(info),
646 _shellpath_info(info) //@@ copies info -> no reference to _create_info !
647{
656}
657
658
660{
662 info._pos.rcNormalPosition,
665 NULL,
666 WS_CLIPCHILDREN | (info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0));
667
668 return static_cast<MDIShellBrowserChild*>(child);
669}
670
671
673{
674 CONTEXT("MDIShellBrowserChild::Init()");
675
676 if (super::Init(pcs))
677 return 1;
678
680
681 return 0;
682}
683
684
686{
687 switch(nmsg) {
688 case PM_DISPATCH_COMMAND: {
689 switch(LOWORD(wparam)) {
690 case ID_WINDOW_NEW: {CONTEXT("MDIShellBrowserChild PM_DISPATCH_COMMAND ID_WINDOW_NEW");
692 break;}
693
694 case ID_REFRESH:
697 break;
698
699 case ID_VIEW_SDI:
701 break;
702
703 default:
704 return super::WndProc(nmsg, wparam, lparam);
705 }
706 return TRUE;}
707
709 /* Forward WM_SYSCOLORCHANGE to common controls */
712 break;
713
714 case PM_TRANSLATE_MSG:
716
717 default:
718 return super::WndProc(nmsg, wparam, lparam);
719 }
720
721 return 0;
722}
723
725{
726 int split_pos = DEFAULT_SPLIT_POS;
727
728 if (_shellBrowser.get()) {
729 split_pos = _split_pos;
730 delete _shellBrowser.release();
731 }
732
733 // create explorer treeview
735 if (!_left_hwnd) {
736 ClientRect rect(_hwnd);
737
740 0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
742 }
743 } else {
744 if (_left_hwnd) {
746 _left_hwnd = 0;
747 }
748 }
749
751 _shellpath_info, this, _cm_ifs));
752
754}
755
756
758{
759 String dir, fname;
760
761 if (!_tcsnicmp(url, TEXT("shell://"), 8)) {
763 return url;
764 }
765
766 if (SplitFileSysURL(url, dir, fname)) {
767
769
771 return FmtString(TEXT("file://%s"), (LPCTSTR)dir);
772 }
773
774 return String();
775}
776
777
779{
780 if (_left_hwnd)
782
783 _shellBrowser->UpdateFolderView(entry->get_shell_folder());
784
785 // set size of new created shell view windows
786 ClientRect rt(_hwnd);
787 resize_children(rt.right, rt.bottom);
788
789 // set new URL
791
792 if (entry->get_path(path, COUNTOF(path))) {
793 String url;
794
795 if (path[0] == ':')
796 url.printf(TEXT("shell://%s"), path);
797 else
798 url.printf(TEXT("file://%s"), path);
799
800 set_url(url);
801 }
802}
803
804#endif
static HDC hDC
Definition: 3dtext.c:33
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4663
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
unsigned int dir
Definition: maze.c:112
#define ID_REFRESH
Definition: resource.h:16
#define CF_HDROP
Definition: constants.h:410
VOID WaitCursor(BOOL bBegin)
Definition: dialog.c:120
static BOOL expand(LPINT ac, LPTSTR **arg, LPCTSTR pattern)
Definition: misc.c:228
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
void AddSuportedFormat(FORMATETC &ftetc)
Definition: dragdropimpl.h:184
virtual ULONG STDMETHODCALLTYPE AddRef()
Definition: dragdropimpl.h:192
virtual ULONG STDMETHODCALLTYPE Release()
OLE drop target for tree controls.
_Tp * get() const _STLP_NOTHROW
Definition: _auto_ptr.h:66
_Tp * release() _STLP_NOTHROW
Definition: _auto_ptr.h:53
_STLP_TEMPLATE_FOR_CONT_EXT iterator find(const _KT &__x)
Definition: _map.h:210
void clear()
Definition: _map.h:206
iterator end()
Definition: _map.h:165
iterator begin()
Definition: _map.h:163
_Rep_type::const_iterator const_iterator
Definition: _map.h:86
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
DWORD bpp
Definition: surface.c:185
unsigned int idx
Definition: utils.c:41
COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk)
Definition: imagelist.c:2889
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
Definition: ole2.c:557
r parent
Definition: btrfs.c:3010
ICONCACHE_FLAGS
Definition: entries.h:66
@ ICF_HICON
Definition: entries.h:72
@ ICF_OVERLAYS
Definition: entries.h:71
@ ICF_OPEN
Definition: entries.h:70
@ SCAN_NO_FILESYSTEM
Definition: entries.h:55
@ SCAN_DONT_ACCESS
Definition: entries.h:54
@ ET_SHELL
Definition: entries.h:37
#define SPLIT_WIDTH
Definition: eventvwr.c:45
#define CLASSNAME_CHILDWND
Definition: explorer.h:75
unsigned long DWORD
Definition: ntddk_ex.h:95
GLfloat GLfloat p
Definition: glext.h:8902
#define fs
Definition: i386-dis.c:444
HRESULT CreateViewWindow([in] IShellView *psvPrevious, [in] LPCFOLDERSETTINGS lpfs, [in] IShellBrowser *psb, [out] RECT *prcView, [out] HWND *phWnd)
HRESULT UIActivate([in] UINT uState)
HRESULT DestroyViewWindow()
HRESULT GetCurrentInfo([out] LPFOLDERSETTINGS lpfs)
HRESULT TranslateAccelerator([in] MSG *pmsg)
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define TEXT(s)
Definition: k32.h:26
#define e
Definition: ke_i.h:82
if(dx< 0)
Definition: linetemp.h:194
@ OWM_EXPLORE
Definition: mainframe.h:32
@ OWM_DETAILS
"rooted" window with special shell namespace root
Definition: mainframe.h:34
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
@ ICID_NONE
Definition: globals.h:64
#define IDC_FILETREE
Definition: resource.h:188
#define ID_WINDOW_NEW
Definition: resource.h:227
#define ID_VIEW_SDI
Definition: resource.h:221
bool SplitFileSysURL(LPCTSTR url, String &dir_out, String &fname_out)
Definition: utility.cpp:504
#define COUNTOF(x)
Definition: utility.h:93
#define PM_TRANSLATE_MSG
Definition: window.h:266
#define PM_DISPATCH_COMMAND
Definition: window.h:265
#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS)
Definition: window.h:215
LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem)
Definition: window.h:968
#define DEFAULT_SPLIT_POS
Definition: window.h:270
static HDC
Definition: imagelist.c:88
static const WCHAR url[]
Definition: encode.c:1432
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static HWND child
Definition: cursoricon.c:298
unsigned int UINT
Definition: ndis.h:50
struct _CONTEXT CONTEXT
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_MAXIMIZE
Definition: pedump.c:623
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPCHILDREN
Definition: pedump.c:619
PUIDLIST_RELATIVE WINAPI ILFindChild(PIDLIST_ABSOLUTE pidl1, PCIDLIST_ABSOLUTE pidl2)
Definition: pidl.c:660
#define ILC_COLOR4
Definition: commctrl.h:354
#define I_IMAGECALLBACK
Definition: commctrl.h:2390
#define TVE_COLLAPSERESET
Definition: commctrl.h:3431
#define TVS_LINESATROOT
Definition: commctrl.h:3254
#define TVI_LAST
Definition: commctrl.h:3375
#define TVIF_TEXT
Definition: commctrl.h:3271
#define TreeView_SelectItem(hwnd, hitem)
Definition: commctrl.h:3486
#define TVHT_ONITEM
Definition: commctrl.h:3532
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3425
#define TreeView_GetChild(hwnd, hitem)
Definition: commctrl.h:3471
#define ILC_COLOR16
Definition: commctrl.h:356
#define ILC_COLOR8
Definition: commctrl.h:355
#define TVIF_IMAGE
Definition: commctrl.h:3272
#define TVSIL_NORMAL
Definition: commctrl.h:3448
#define LPNMTREEVIEW
Definition: commctrl.h:3648
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3257
#define ILC_COLOR32
Definition: commctrl.h:358
#define TVS_HASLINES
Definition: commctrl.h:3253
#define LPSTR_TEXTCALLBACK
Definition: commctrl.h:2388
#define TVE_EXPAND
Definition: commctrl.h:3428
#define TV_INSERTSTRUCT
Definition: commctrl.h:3382
#define WC_TREEVIEW
Definition: commctrl.h:3250
#define TV_ITEM
Definition: commctrl.h:3305
#define TreeView_GetRoot(hwnd)
Definition: commctrl.h:3480
#define TreeView_SetScrollTime(hwnd, uTime)
Definition: commctrl.h:3589
#define TVE_COLLAPSE
Definition: commctrl.h:3427
#define TreeView_GetNextSibling(hwnd, hitem)
Definition: commctrl.h:3472
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define TVIS_OVERLAYMASK
Definition: commctrl.h:3292
#define TVS_HASBUTTONS
Definition: commctrl.h:3252
#define ILC_MASK
Definition: commctrl.h:351
#define INDEXTOOVERLAYMASK(i)
Definition: commctrl.h:425
#define TVIF_PARAM
Definition: commctrl.h:3273
#define LPNMTVDISPINFO
Definition: commctrl.h:3681
#define LVHT_NOWHERE
Definition: commctrl.h:2498
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3452
#define TVIF_CHILDREN
Definition: commctrl.h:3277
#define TreeView_HitTest(hwnd, lpht)
Definition: commctrl.h:3518
#define ILC_COLOR24
Definition: commctrl.h:357
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3417
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3276
#define TreeView_SetItem(hwnd, pitem)
Definition: commctrl.h:3502
#define TVIF_STATE
Definition: commctrl.h:3274
#define ILC_COLOR
Definition: commctrl.h:352
#define TreeView_DeleteItem(hwnd, hitem)
Definition: commctrl.h:3420
#define C_DRIVE_STR
Definition: shellbrowser.h:182
#define C_DRIVE
Definition: shellbrowser.h:188
ShellFolder & GetDesktopFolder()
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
#define CHECKERROR(hr)
Definition: shellclasses.h:162
HRESULT hr
Definition: shlfolder.c:183
#define SFVM_INITMENUPOPUP
Definition: shlobj.h:1300
struct _SFV_CREATE SFV_CREATE
@ FWF_NOCLIENTEDGE
Definition: shobjidl.idl:651
@ FWF_BESTFITWINDOW
Definition: shobjidl.idl:646
@ FVM_ICON
Definition: shobjidl.idl:679
@ FVM_DETAILS
Definition: shobjidl.idl:683
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
& rect
Definition: startmenu.cpp:1413
virtual void entry_selected(Entry *entry)=0
Definition: shlobj.h:572
UINT aoffset[1]
Definition: shlobj.h:573
UINT cidl
Definition: shlobj.h:572
Exception with context information.
Definition: shellclasses.h:114
int _split_pos
Definition: window.h:328
HWND _hwndFrame
Definition: window.h:331
WindowHandle _left_hwnd
Definition: window.h:324
WindowHandle _right_hwnd
Definition: window.h:325
virtual void resize_children(int cx, int cy)
Definition: window.cpp:527
String _url
Definition: window.h:333
void set_url(LPCTSTR url)
Definition: window.cpp:567
static ChildWindow * create(const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0)
Definition: window.cpp:369
base of all file and directory entries
Definition: entries.h:83
void smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:353
Explorer command line parser.
Definition: explorer.h:90
HINSTANCE _hInstance
Definition: globals.h:270
IconCache _icon_cache
Definition: globals.h:285
HWND _hMainWnd
Definition: globals.h:275
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
const Icon & get_icon(int icon_id)
Definition: explorer.cpp:625
void free_icon(int icon_id)
Definition: explorer.cpp:650
HICON get_hicon() const
Definition: globals.h:110
static MDIShellBrowserChild * create(const ShellChildWndInfo &info)
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
ShellChildWndInfo _create_info
Definition: shellbrowser.h:264
virtual void entry_selected(Entry *entry)
MDIShellBrowserChild(HWND hwnd, const ShellChildWndInfo &info)
ShellPathInfo _shellpath_info
Definition: shellbrowser.h:265
LRESULT Init(LPCREATESTRUCT)
virtual String jump_to_int(LPCTSTR url)
static int OpenShellFolders(LPIDA pida, HWND hFrameWnd)
Definition: mainframe.cpp:77
static HWND Create(const ExplorerCmd &cmd)
Definition: mainframe.cpp:40
auto_ptr< ShellBrowser > _shellBrowser
Definition: shellbrowser.h:209
Implementation of IShellBrowserImpl interface in explorer child windows.
Definition: ieframe.h:84
bool TranslateAccelerator(LPMSG lpmsg)
HRESULT OnDefaultCommand(LPIDA pida)
HIMAGELIST _himl_old
Definition: shellbrowser.h:151
TreeDropTarget * _pDropTarget
Definition: shellbrowser.h:157
void OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv)
void UpdateFolderView(IShellFolder *folder)
HIMAGELIST _himl
Definition: shellbrowser.h:150
WindowHandle & _right_hwnd
Definition: shellbrowser.h:148
ShellBrowser(HWND hwnd, HWND hwndFrame, HWND left_hwnd, WindowHandle &right_hwnd, ShellPathInfo &create_info, BrowserCallback *cb, CtxMenuInterfaces &cm_ifs)
ShellFolder _folder
Definition: shellbrowser.h:154
void OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv)
int InsertSubitems(HTREEITEM hParentItem, Entry *entry, IShellFolder *pParentFolder)
void InitializeTree()
void jump_to(LPCITEMIDLIST pidl)
HTREEITEM _last_sel
Definition: shellbrowser.h:159
virtual HRESULT STDMETHODCALLTYPE MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
shell view callback
BrowserCallback * _callback
Definition: shellbrowser.h:152
void invalidate_cache()
CtxMenuInterfaces & _cm_ifs
Definition: shellbrowser.h:164
bool jump_to_pidl(LPCITEMIDLIST pidl)
map< int, int > _image_map
Definition: shellbrowser.h:174
bool select_folder(Entry *entry, bool expand)
bool InitDragDrop()
IShellView * _pShellView
Definition: shellbrowser.h:156
HTREEITEM select_entry(HTREEITEM hitem, Entry *entry, bool expand=true)
ShellPathInfo & _create_info
Definition: shellbrowser.h:149
virtual ~ShellBrowser()
ShellDirectory * _cur_dir
Definition: shellbrowser.h:162
void OnTreeItemRClick(int idCtrl, LPNMHDR pnmh)
void OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh)
int get_image_idx(int icon_id)
information structure for creation of MDIShellBrowserChild
Definition: filechild.h:45
shell folder entry
Definition: shellfs.h:54
virtual Entry * find_entry(const void *)
Definition: shellfs.cpp:495
shell file/directory entry
Definition: shellfs.h:31
virtual ShellPath create_absolute_pidl() const
Definition: shellfs.cpp:114
IShellFolder smart pointer.
Definition: shellclasses.h:594
String get_name(LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const
information structure to hold current shell folder information
Definition: shellbrowser.h:35
ShellPath _shell_path
Definition: shellbrowser.h:45
ShellPath _root_shell_path
Definition: shellbrowser.h:46
wrapper class for item ID lists
Definition: shellclasses.h:652
virtual LRESULT Init(LPCREATESTRUCT pcs)
Definition: window.cpp:241
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1360
IShellView * psvOuter
Definition: shlobj.h:1359
UINT cbSize
Definition: shlobj.h:1357
IShellFolder * pshf
Definition: shlobj.h:1358
Definition: fci.c:116
Definition: ffs.h:70
HWND hwnd
Definition: winuser.h:3117
HTREEITEM hItem
Definition: commctrl.h:3526
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
#define DRIVE_UNKNOWN
Definition: winbase.h:281
#define ZeroMemory
Definition: winbase.h:1736
#define lstrcpy
Definition: winbase.h:3898
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define BITSPIXEL
Definition: wingdi.h:720
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CreateWindowEx
Definition: winuser.h:5767
#define SW_SHOWMAXIMIZED
Definition: winuser.h:776
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_WINDOW
Definition: winuser.h:921
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2722
#define SM_CYSMICON
Definition: winuser.h:1016
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define SM_CXSMICON
Definition: winuser.h:1015
#define MF_BYPOSITION
Definition: winuser.h:203
#define SendMessage
Definition: winuser.h:5855
HDC WINAPI GetDC(_In_opt_ HWND)
#define CW_USEDEFAULT
Definition: winuser.h:225
HWND WINAPI GetParent(_In_ HWND)
#define InsertMenu
Definition: winuser.h:5815
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
#define WM_SETREDRAW
Definition: winuser.h:1619
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
char TCHAR
Definition: xmlstorage.h:189
#define _tcsnicmp
Definition: xmlstorage.h:207
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define SORT_NAME
Definition: xpath.c:439