ReactOS  0.4.13-dev-464-g6b95727
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 
36 ShellBrowser::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 {
47  _pShellView = NULL;
49  _last_sel = 0;
50 
51  _cur_dir = NULL;
52 
53  HDC hDC = GetDC(NULL);
54  if (hDC)
55  {
57  ReleaseDC(NULL, hDC);
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) {
116  InitializeTree();
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 
207  _pDropTarget->AddRef();
208 
209  if (FAILED(RegisterDragDrop(_left_hwnd, _pDropTarget))) {//calls addref
210  _pDropTarget->Release(); // free TreeDropTarget
211  _pDropTarget = NULL;
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 
280  g_Globals._icon_cache.free_icon(it->first);
281 
282  _image_map.clear();
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 
306  TreeView_SetItem(_left_hwnd, &tvItem);
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 
373  (void)TreeView_InsertItem(_left_hwnd, &tvInsert);
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);
405  ScreenToClient(_left_hwnd, &tvhti.pt);
406 
407  tvhti.flags = LVHT_NOWHERE;
408  (void)TreeView_HitTest(_left_hwnd, &tvhti);
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;
415  ClientToScreen(_left_hwnd, &tvhti.pt);
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)) {
454  _pShellView = NULL;
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 
533  if (expand && !TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND))
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 
598  hwnd = GetParent(hwnd);
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)
621  if (!TreeView_Expand(_left_hwnd, hitem, TVE_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 
708  case WM_SYSCOLORCHANGE:
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,
741  _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0);
742  }
743  } else {
744  if (_left_hwnd) {
746  _left_hwnd = 0;
747  }
748  }
749 
751  _shellpath_info, this, _cm_ifs));
752 
753  _shellBrowser->Init();
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
information structure for creation of MDIShellBrowserChild
Definition: filechild.h:44
virtual ShellPath create_absolute_pidl() const
Definition: shellfs.cpp:114
bool TranslateAccelerator(LPMSG lpmsg)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ILC_COLOR16
Definition: commctrl.h:341
#define BITSPIXEL
Definition: wingdi.h:719
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
struct _CONTEXT CONTEXT
#define TRUE
Definition: types.h:120
HRESULT OnDefaultCommand(LPIDA pida)
Explorer command line parser.
Definition: explorer.h:89
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define ID_REFRESH
Definition: resource.h:18
void AddSuportedFormat(FORMATETC &ftetc)
Definition: dragdropimpl.h:184
Definition: fci.c:115
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
HRESULT CreateViewWindow([in] IShellView *psvPrevious, [in] LPCFOLDERSETTINGS lpfs, [in] IShellBrowser *psb, [out] RECT *prcView, [out] HWND *phWnd)
static MDIShellBrowserChild * create(const ShellChildWndInfo &info)
COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk)
Definition: imagelist.c:2830
virtual HRESULT STDMETHODCALLTYPE MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
shell view callback
WindowHandle & _right_hwnd
Definition: shellbrowser.h:148
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
HRESULT hr
Definition: shlfolder.c:183
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1276
HIMAGELIST _himl_old
Definition: shellbrowser.h:151
#define InsertMenu
Definition: winuser.h:5669
HWND _hwndFrame
Definition: window.h:331
HDC WINAPI GetDC(_In_opt_ HWND)
WindowHandle _left_hwnd
Definition: window.h:324
LRESULT Init(LPCREATESTRUCT)
information structure to hold current shell folder information
Definition: shellbrowser.h:34
HTREEITEM _last_sel
Definition: shellbrowser.h:159
#define SW_SHOWMAXIMIZED
Definition: winuser.h:767
#define TreeView_GetChild(hwnd, hitem)
Definition: commctrl.h:3438
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define TVS_LINESATROOT
Definition: commctrl.h:3221
virtual LRESULT Init(LPCREATESTRUCT pcs)
Definition: window.cpp:241
#define IDC_FILETREE
Definition: resource.h:188
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
static HDC
Definition: imagelist.c:92
#define WM_SETREDRAW
Definition: winuser.h:1598
WindowHandle _right_hwnd
Definition: window.h:325
IShellView * psvOuter
Definition: shlobj.h:1275
#define LPNMTREEVIEW
Definition: commctrl.h:3615
#define ZeroMemory
Definition: winbase.h:1635
shell folder entry
Definition: shellfs.h:53
#define SM_CYSMICON
Definition: winuser.h:1003
HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
Definition: ole2.c:560
int InsertSubitems(HTREEITEM hParentItem, Entry *entry, IShellFolder *pParentFolder)
static WCHAR String[]
Definition: stringtable.c:55
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
#define TreeView_GetNextSibling(hwnd, hitem)
Definition: commctrl.h:3439
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3243
#define WS_CLIPCHILDREN
Definition: pedump.c:619
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
Definition: fs.h:235
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3446
BOOL WINAPI DestroyWindow(_In_ HWND)
#define COLOR_WINDOW
Definition: winuser.h:908
int32_t INT
Definition: typedefs.h:56
#define PM_TRANSLATE_MSG
Definition: window.h:266
static HWND child
Definition: cursoricon.c:298
DWORD WINAPI GetSysColor(_In_ int)
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
#define SPLIT_WIDTH
Definition: eventvwr.c:62
map< int, int > _image_map
Definition: shellbrowser.h:174
#define ILC_COLOR4
Definition: commctrl.h:339
static HWND Create(const ExplorerCmd &cmd)
Definition: mainframe.cpp:40
void invalidate_cache()
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:925
#define ILC_COLOR32
Definition: commctrl.h:343
Exception with context information.
Definition: shellclasses.h:113
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3384
void OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv)
CtxMenuInterfaces & _cm_ifs
Definition: shellbrowser.h:164
#define LVHT_NOWHERE
Definition: commctrl.h:2465
BrowserCallback * _callback
Definition: shellbrowser.h:152
void free_icon(int icon_id)
Definition: explorer.cpp:650
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:801
unsigned char * LPBYTE
Definition: typedefs.h:52
#define TVIF_CHILDREN
Definition: commctrl.h:3244
HRESULT DestroyViewWindow()
#define _tcsnicmp
Definition: xmlstorage.h:207
#define DEFAULT_SPLIT_POS
Definition: window.h:270
#define e
Definition: ke_i.h:82
_Tp * release() _STLP_NOTHROW
Definition: _auto_ptr.h:53
#define MF_BYPOSITION
Definition: winuser.h:203
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define TVS_HASBUTTONS
Definition: commctrl.h:3219
void OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ILC_COLOR
Definition: commctrl.h:337
unsigned int idx
Definition: utils.c:41
ULONG Release()
#define CreateWindowEx
Definition: winuser.h:5621
#define CW_USEDEFAULT
Definition: winuser.h:225
#define CLASSNAME_CHILDWND
Definition: explorer.h:75
#define TVIS_OVERLAYMASK
Definition: commctrl.h:3259
smooth NULL
Definition: ftsmooth.c:416
#define TVE_COLLAPSE
Definition: commctrl.h:3394
#define CF_HDROP
Definition: constants.h:410
HICON get_hicon() const
Definition: globals.h:110
LONG_PTR LPARAM
Definition: windef.h:208
void OnTreeItemRClick(int idCtrl, LPNMHDR pnmh)
bool jump_to_pidl(LPCITEMIDLIST pidl)
#define TVI_LAST
Definition: commctrl.h:3342
virtual void entry_selected(Entry *entry)
String get_name(LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const
unsigned int dir
Definition: maze.c:112
struct _SFV_CREATE SFV_CREATE
_Tp * get() const _STLP_NOTHROW
Definition: _auto_ptr.h:66
struct CFFOLDER folder
Definition: fdi.c:110
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3419
static BOOL expand(LPINT ac, LPTSTR **arg, LPCTSTR pattern)
Definition: misc.c:215
#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS)
Definition: window.h:215
#define CHECKERROR(hr)
Definition: shellclasses.h:162
virtual ULONG STDMETHODCALLTYPE AddRef()
Definition: dragdropimpl.h:192
#define DRIVE_UNKNOWN
Definition: winbase.h:253
ShellPath _root_shell_path
Definition: shellbrowser.h:46
#define ID_VIEW_SDI
Definition: resource.h:221
HTREEITEM hItem
Definition: commctrl.h:3493
HIMAGELIST _himl
Definition: shellbrowser.h:150
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define TreeView_DeleteItem(hwnd, hitem)
Definition: commctrl.h:3387
OLE drop target for tree controls.
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
char TCHAR
Definition: xmlstorage.h:189
#define C_DRIVE
Definition: shellbrowser.h:188
ShellFolder _folder
Definition: shellbrowser.h:154
"rooted" window with special shell namespace root
Definition: mainframe.h:34
#define WC_TREEVIEW
Definition: commctrl.h:3217
#define ID_WINDOW_NEW
Definition: resource.h:227
r parent
Definition: btrfs.c:2708
static IShellFolder ShellFolder
Definition: ordinal.c:2632
void smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:353
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define TreeView_HitTest(hwnd, lpht)
Definition: commctrl.h:3485
LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:641
LONG HRESULT
Definition: typedefs.h:77
bool select_folder(Entry *entry, bool expand)
static const WCHAR url[]
Definition: encode.c:1432
#define ILC_COLOR24
Definition: commctrl.h:342
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
int WINAPI GetSystemMetrics(_In_ int)
UINT cidl
Definition: shlobj.h:491
unsigned long DWORD
Definition: ntddk_ex.h:95
String _url
Definition: window.h:333
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:537
static DWORD cb
Definition: integrity.c:41
Definition: _map.h:44
ShellChildWndInfo _create_info
Definition: shellbrowser.h:264
#define TVE_EXPAND
Definition: commctrl.h:3395
static ChildWindow * create(const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0)
Definition: window.cpp:369
#define SORT_NAME
Definition: xpath.c:441
#define INDEXTOOVERLAYMASK(i)
Definition: commctrl.h:410
#define SM_CXSMICON
Definition: winuser.h:1002
void UpdateFolderView(IShellFolder *folder)
void clear()
Definition: _map.h:206
ShellPath _shell_path
Definition: shellbrowser.h:45
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
_STLP_TEMPLATE_FOR_CONT_EXT iterator find(const _KT &__x)
Definition: _map.h:210
HINSTANCE _hInstance
Definition: globals.h:270
ICONCACHE_FLAGS
Definition: entries.h:66
void set_url(LPCTSTR url)
Definition: window.cpp:567
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
uint32_t entry
Definition: isohybrid.c:63
#define ILC_MASK
Definition: commctrl.h:336
void OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh)
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
const Icon & get_icon(int icon_id)
Definition: explorer.cpp:625
virtual ULONG STDMETHODCALLTYPE Release()
#define WS_TABSTOP
Definition: pedump.c:634
shell file/directory entry
Definition: shellfs.h:30
IShellView * _pShellView
Definition: shellbrowser.h:156
HRESULT TranslateAccelerator([in] MSG *pmsg)
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual void entry_selected(Entry *entry)=0
MDIShellBrowserChild(HWND hwnd, const ShellChildWndInfo &info)
ShellFolder & GetDesktopFolder()
#define I_IMAGECALLBACK
Definition: commctrl.h:2357
static HDC hDC
Definition: 3dtext.c:33
IShellFolder * pshf
Definition: shlobj.h:1274
#define TreeView_SetScrollTime(hwnd, uTime)
Definition: commctrl.h:3556
HWND WINAPI GetParent(_In_ HWND)
HRESULT UIActivate([in] UINT uState)
#define TV_ITEM
Definition: commctrl.h:3272
#define S_OK
Definition: intsafe.h:59
#define TEXT(s)
Definition: k32.h:26
HTREEITEM select_entry(HTREEITEM hitem, Entry *entry, bool expand=true)
#define TreeView_GetRoot(hwnd)
Definition: commctrl.h:3447
UINT cbSize
Definition: shlobj.h:1273
ShellPathInfo _shellpath_info
Definition: shellbrowser.h:265
#define TVIF_TEXT
Definition: commctrl.h:3238
#define fs
Definition: i386-dis.c:435
#define lstrcpy
Definition: winbase.h:3688
virtual ~ShellBrowser()
#define TreeView_SelectItem(hwnd, hitem)
Definition: commctrl.h:3453
void InitializeTree()
virtual void resize_children(int cx, int cy)
Definition: window.cpp:527
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: services.c:325
#define TVIF_IMAGE
Definition: commctrl.h:3239
virtual Entry * find_entry(const void *)
Definition: shellfs.cpp:495
static int OpenShellFolders(LPIDA pida, HWND hFrameWnd)
Definition: mainframe.cpp:77
int _split_pos
Definition: window.h:328
HWND _hMainWnd
Definition: globals.h:275
UINT aoffset[1]
Definition: shlobj.h:492
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
unsigned int UINT
Definition: ndis.h:50
ShellBrowser(HWND hwnd, HWND hwndFrame, HWND left_hwnd, WindowHandle &right_hwnd, ShellPathInfo &create_info, BrowserCallback *cb, CtxMenuInterfaces &cm_ifs)
HWND hwnd
Definition: winuser.h:3067
#define TreeView_SetItem(hwnd, pitem)
Definition: commctrl.h:3469
#define LPNMTVDISPINFO
Definition: commctrl.h:3648
ShellPathInfo & _create_info
Definition: shellbrowser.h:149
ShellDirectory * _cur_dir
Definition: shellbrowser.h:162
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3224
#define TVS_HASLINES
Definition: commctrl.h:3220
#define TVSIL_NORMAL
Definition: commctrl.h:3415
HRESULT GetCurrentInfo([out] LPFOLDERSETTINGS lpfs)
#define SendMessage
Definition: winuser.h:5709
bool InitDragDrop()
TreeDropTarget * _pDropTarget
Definition: shellbrowser.h:157
#define SFVM_INITMENUPOPUP
Definition: shlobj.h:1218
#define ILC_COLOR8
Definition: commctrl.h:340
#define TVIF_STATE
Definition: commctrl.h:3241
#define COUNTOF(x)
Definition: utility.h:93
DWORD bpp
Definition: surface.c:181
#define TVIF_PARAM
Definition: commctrl.h:3240
#define C_DRIVE_STR
Definition: shellbrowser.h:182
void jump_to(LPCITEMIDLIST pidl)
GLfloat GLfloat p
Definition: glext.h:8902
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define LPSTR_TEXTCALLBACK
Definition: commctrl.h:2355
LONG_PTR LRESULT
Definition: windef.h:209
iterator begin()
Definition: _map.h:163
#define TVHT_ONITEM
Definition: commctrl.h:3499
LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem)
Definition: window.h:968
#define TV_INSERTSTRUCT
Definition: commctrl.h:3349
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3392
#define WS_VISIBLE
Definition: pedump.c:620
#define PM_DISPATCH_COMMAND
Definition: window.h:265
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
wrapper class for item ID lists
Definition: shellclasses.h:651
#define LOWORD(l)
Definition: pedump.c:82
auto_ptr< ShellBrowser > _shellBrowser
Definition: shellbrowser.h:209
base of all file and directory entries
Definition: entries.h:82
virtual String jump_to_int(LPCTSTR url)
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: shlobj.h:490
static UINT WPARAM wparam
Definition: combo.c:716
bool SplitFileSysURL(LPCTSTR url, String &dir_out, String &fname_out)
Definition: utility.cpp:504
IconCache _icon_cache
Definition: globals.h:285
static IShellBrowser ShellBrowser
Definition: htmldoc.c:3702
#define WS_MAXIMIZE
Definition: pedump.c:623
iterator end()
Definition: _map.h:165
int get_image_idx(int icon_id)
#define TVE_COLLAPSERESET
Definition: commctrl.h:3398