ReactOS  0.4.15-dev-425-gc40b086
explorerband.cpp
Go to the documentation of this file.
1 /*
2  * ReactOS Explorer
3  *
4  * Copyright 2016 Sylvain Deverre <deverre dot sylv at gmail dot com>
5  * Copyright 2020 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */
21 
22 #include "precomp.h"
23 #include <commoncontrols.h>
24 #include <undocshell.h>
25 
26 #if 1
27 #undef UNIMPLEMENTED
28 
29 #define UNIMPLEMENTED DbgPrint("%s is UNIMPLEMENTED!\n", __FUNCTION__)
30 #endif
31 
32 /*
33  * TODO:
34  * - Monitor correctly "external" shell interrupts (seems like we need to register/deregister them for each folder)
35  * - find and fix what cause explorer crashes sometimes (seems to be explorer that does more releases than addref)
36  * - TESTING
37  */
38 
39 typedef struct _PIDLDATA
40 {
42  BYTE data[1];
44 
45 #define PT_GUID 0x1F
46 #define PT_SHELLEXT 0x2E
47 #define PT_YAGUID 0x70
48 
50 {
51  LPPIDLDATA lpPData = (LPPIDLDATA)&pidl->mkid.abID;
52 
53  return (pidl &&
54  ((lpPData && (PT_GUID == lpPData->type || PT_SHELLEXT== lpPData->type ||
55  PT_YAGUID == lpPData->type)) || (pidl && pidl->mkid.cb == 0x00)));
56 }
57 
59 {
60  IShellFolder *pShellFolder = NULL;
61  LPCITEMIDLIST pidlRelative = NULL;
62  STRRET str;
63  HRESULT hr;
64 
65  if (pidlDirectory == NULL || szDisplayName == NULL)
66  {
67  return E_FAIL;
68  }
69 
70  hr = SHBindToParent(pidlDirectory, IID_PPV_ARG(IShellFolder, &pShellFolder), &pidlRelative);
71 
72  if (SUCCEEDED(hr))
73  {
74  hr = pShellFolder->GetDisplayNameOf(pidlRelative,uFlags,&str);
75  if (SUCCEEDED(hr))
76  {
77  hr = StrRetToBuf(&str,pidlDirectory,szDisplayName,cchMax);
78  }
79  pShellFolder->Release();
80  }
81  return hr;
82 }
83 
84 /*
85  This is a Windows hack, because shell event messages in Windows gives an
86  ill-formed PIDL stripped from useful data that parses incorrectly with SHGetFileInfo.
87  So we need to re-enumerate subfolders until we find one with the same name.
88  */
90 {
91  HRESULT hr;
94  CComPtr<IEnumIDList> pEnumIDList;
95  LPITEMIDLIST childPidl;
96  LPITEMIDLIST correctChild;
97  LPITEMIDLIST correctParent;
98  ULONG fetched;
99  DWORD EnumFlags;
100 
101 
102  EnumFlags = SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN;
103  hr = SHBindToParent(buggyPidl, IID_PPV_ARG(IShellFolder, &folder), (LPCITEMIDLIST*)&childPidl);
104  *cleanPidl = NULL;
105  if (!SUCCEEDED(hr))
106  {
107  ERR("Can't bind to parent folder\n");
108  return hr;
109  }
110  hr = folder->QueryInterface(IID_PPV_ARG(IPersistFolder2, &persist));
111  if (!SUCCEEDED(hr))
112  {
113  ERR("PIDL doesn't belong to the shell namespace, aborting\n");
114  return hr;
115  }
116 
117  hr = persist->GetCurFolder(&correctParent);
118  if (!SUCCEEDED(hr))
119  {
120  ERR("Unable to get current folder\n");
121  return hr;
122  }
123 
124  hr = folder->EnumObjects(NULL,EnumFlags,&pEnumIDList);
125  // avoid broken IShellFolder implementations that return null pointer with success
126  if (!SUCCEEDED(hr) || !pEnumIDList)
127  {
128  ERR("Can't enum the folder !\n");
129  return hr;
130  }
131 
132  while(SUCCEEDED(pEnumIDList->Next(1, &correctChild, &fetched)) && correctChild && fetched)
133  {
134  if (!folder->CompareIDs(0, childPidl, correctChild))
135  {
136  *cleanPidl = ILCombine(correctParent, correctChild);
137  ILFree(correctChild);
138  goto Cleanup;
139  }
140  ILFree(correctChild);
141  }
142 Cleanup:
143  ILFree(correctParent);
144  return hr;
145 }
146 
148  : m_pSite(NULL)
149  , m_fVisible(FALSE)
150  , m_bNavigating(FALSE)
151  , m_dwBandID(0)
152  , m_pidlCurrent(NULL)
153 {
154 }
155 
157 {
158  if (m_pidlCurrent)
159  {
161  }
162 }
163 
165 {
166  // Init the treeview here
167  HRESULT hr;
168  LPITEMIDLIST pidl;
169  CComPtr<IWebBrowser2> browserService;
170  SHChangeNotifyEntry shcne;
171 
173  if (FAILED_UNEXPECTEDLY(hr))
174  return;
175 
176  hr = SHGetFolderLocation(m_hWnd, CSIDL_DESKTOP, NULL, 0, &pidl);
177  if (FAILED_UNEXPECTEDLY(hr))
178  return;
179 
180  IImageList * piml;
182  if (FAILED_UNEXPECTEDLY(hr))
183  return;
184 
186 
187  // Insert the root node
188  m_hRoot = InsertItem(0, m_pDesktop, pidl, pidl, FALSE);
189  if (!m_hRoot)
190  {
191  ERR("Failed to create root item\n");
192  return;
193  }
194 
195  NodeInfo* pNodeInfo = GetNodeInfo(m_hRoot);
196 
197  // Insert child nodes
198  InsertSubitems(m_hRoot, pNodeInfo);
200 
201  // Navigate to current folder position
203 
204  // Register shell notification
205  shcne.pidl = pidl;
206  shcne.fRecursive = TRUE;
208  m_hWnd,
212  1,
213  &shcne);
214  if (!m_shellRegID)
215  {
216  ERR("Something went wrong, error %08x\n", GetLastError());
217  }
218  // Register browser connection endpoint
219  hr = IUnknown_QueryService(m_pSite, SID_SWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &browserService));
220  if (FAILED_UNEXPECTEDLY(hr))
221  return;
222 
223  hr = AtlAdvise(browserService, dynamic_cast<IDispatch*>(this), DIID_DWebBrowserEvents, &m_adviseCookie);
224  if (FAILED_UNEXPECTEDLY(hr))
225  return;
226 
227  ILFree(pidl);
228 }
229 
231 {
232  HRESULT hr;
233  CComPtr <IWebBrowser2> browserService;
234 
235  TRACE("Cleaning up explorer band ...\n");
236 
237  hr = IUnknown_QueryService(m_pSite, SID_SWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &browserService));
238  if (FAILED_UNEXPECTEDLY(hr))
239  return;
240 
241  hr = AtlUnadvise(browserService, DIID_DWebBrowserEvents, m_adviseCookie);
242  /* Remove all items of the treeview */
243  RevokeDragDrop(m_hWnd);
244  TreeView_DeleteAllItems(m_hWnd);
245  m_pDesktop = NULL;
246  m_hRoot = NULL;
247  TRACE("Cleanup done !\n");
248 }
249 
251 {
252  TVITEM tvItem;
253 
254  tvItem.mask = TVIF_PARAM;
255  tvItem.hItem = hItem;
256 
257  if (!TreeView_GetItem(m_hWnd, &tvItem))
258  return 0;
259 
260  return reinterpret_cast<NodeInfo*>(tvItem.lParam);
261 }
262 
264 {
265  CComPtr<IOleWindow> pBrowserOleWnd;
266  CMINVOKECOMMANDINFO cmi;
267  HWND browserWnd;
268  HRESULT hr;
269 
271  if (FAILED_UNEXPECTEDLY(hr))
272  return hr;
273 
274  hr = pBrowserOleWnd->GetWindow(&browserWnd);
275  if (FAILED_UNEXPECTEDLY(hr))
276  return hr;
277 
278  ZeroMemory(&cmi, sizeof(cmi));
279  cmi.cbSize = sizeof(cmi);
280  cmi.lpVerb = MAKEINTRESOURCEA(nCmd);
281  cmi.hwnd = browserWnd;
282  if (GetKeyState(VK_SHIFT) & 0x8000)
283  cmi.fMask |= CMIC_MASK_SHIFT_DOWN;
284  if (GetKeyState(VK_CONTROL) & 0x8000)
285  cmi.fMask |= CMIC_MASK_CONTROL_DOWN;
286 
287  return menu->InvokeCommand(&cmi);
288 }
289 
291 {
292  CComPtr<IShellBrowser> pBrowserService;
293  HRESULT hr;
294 
295  hr = IUnknown_QueryService(m_pSite, SID_STopLevelBrowser, IID_PPV_ARG(IShellBrowser, &pBrowserService));
296  if (FAILED_UNEXPECTEDLY(hr))
297  return hr;
298 
299  hr = pBrowserService->BrowseObject(pidlGoto, SBSP_SAMEBROWSER | SBSP_ABSOLUTE);
300  if (FAILED_UNEXPECTEDLY(hr))
301  return hr;
302 
303  if (m_pidlCurrent)
304  {
306  m_pidlCurrent = ILClone(pidlGoto);
307  }
308  return hr;
309 }
310 
311 // *** notifications handling ***
313 {
314  NodeInfo *pNodeInfo;
315 
316  if (pnmtv->action == TVE_COLLAPSE) {
317  if (pnmtv->itemNew.hItem == m_hRoot)
318  {
319  // Prenvent root from collapsing
320  pnmtv->itemNew.mask |= TVIF_STATE;
321  pnmtv->itemNew.stateMask |= TVIS_EXPANDED;
322  pnmtv->itemNew.state &= ~TVIS_EXPANDED;
323  pnmtv->action = TVE_EXPAND;
324  return TRUE;
325  }
326  }
327  if (pnmtv->action == TVE_EXPAND) {
328  // Grab our directory PIDL
329  pNodeInfo = GetNodeInfo(pnmtv->itemNew.hItem);
330  // We have it, let's try
331  if (pNodeInfo && !pNodeInfo->expanded)
332  if (!InsertSubitems(pnmtv->itemNew.hItem, pNodeInfo)) {
333  // remove subitem "+" since we failed to add subitems
334  TV_ITEM tvItem;
335 
336  tvItem.mask = TVIF_CHILDREN;
337  tvItem.hItem = pnmtv->itemNew.hItem;
338  tvItem.cChildren = 0;
339 
340  TreeView_SetItem(m_hWnd, &tvItem);
341  }
342  }
343  return FALSE;
344 }
345 
347 {
348  /* Destroy memory associated to our node */
349  NodeInfo* ptr = GetNodeInfo(pnmtv->itemNew.hItem);
350  if (ptr)
351  {
352  ILFree(ptr->relativePidl);
353  ILFree(ptr->absolutePidl);
354  delete ptr;
355  }
356  return TRUE;
357 }
358 
360 {
361  NodeInfo* pNodeInfo = GetNodeInfo(pnmtv->itemNew.hItem);
362 
363  /* Prevents navigation if selection is initiated inside the band */
364  if (m_bNavigating)
365  return;
366 
367  UpdateBrowser(pNodeInfo->absolutePidl);
368 
369  SetFocus();
370  // Expand the node
371  //TreeView_Expand(m_hWnd, pnmtv->itemNew.hItem, TVE_EXPAND);
372 }
373 
375 {
376  CComPtr<IShellFolder> pSrcFolder;
378  LPCITEMIDLIST pLast;
379  HRESULT hr;
380  DWORD dwEffect;
381  DWORD dwEffect2;
382 
383  dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE;
384  if (!pnmtv->itemNew.lParam)
385  return;
386  NodeInfo* pNodeInfo = GetNodeInfo(pnmtv->itemNew.hItem);
387  hr = SHBindToParent(pNodeInfo->absolutePidl, IID_PPV_ARG(IShellFolder, &pSrcFolder), &pLast);
388  if (!SUCCEEDED(hr))
389  return;
390  hr = pSrcFolder->GetUIObjectOf(m_hWnd, 1, &pLast, IID_IDataObject, 0, reinterpret_cast<void**>(&pObj));
391  if (!SUCCEEDED(hr))
392  return;
393  DoDragDrop(pObj, this, dwEffect, &dwEffect2);
394  return;
395 }
396 
397 
398 // *** ATL event handlers ***
400 {
401  HTREEITEM item;
402  NodeInfo *info;
403  HMENU treeMenu;
404  WORD x;
405  WORD y;
406  CComPtr<IShellFolder> pFolder;
407  CComPtr<IContextMenu> contextMenu;
408  HRESULT hr;
409  UINT uCommand;
410  LPITEMIDLIST pidlChild;
411 
412  treeMenu = NULL;
413  item = TreeView_GetSelection(m_hWnd);
414  bHandled = TRUE;
415  if (!item)
416  {
417  goto Cleanup;
418  }
419 
420  x = LOWORD(lParam);
421  y = HIWORD(lParam);
422  if (x == -1 && y == -1)
423  {
424  // TODO: grab position of tree item and position it correctly
425  }
426 
427  info = GetNodeInfo(item);
428  if (!info)
429  {
430  ERR("No node data, something has gone wrong !\n");
431  goto Cleanup;
432  }
433  hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pFolder),
434  (LPCITEMIDLIST*)&pidlChild);
435  if (!SUCCEEDED(hr))
436  {
437  ERR("Can't bind to folder!\n");
438  goto Cleanup;
439  }
440  hr = pFolder->GetUIObjectOf(m_hWnd, 1, (LPCITEMIDLIST*)&pidlChild, IID_IContextMenu,
441  NULL, reinterpret_cast<void**>(&contextMenu));
442  if (!SUCCEEDED(hr))
443  {
444  ERR("Can't get IContextMenu interface\n");
445  goto Cleanup;
446  }
447 
448  IUnknown_SetSite(contextMenu, (IDeskBand *)this);
449 
450  treeMenu = CreatePopupMenu();
451  hr = contextMenu->QueryContextMenu(treeMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST,
452  CMF_EXPLORE);
453  if (!SUCCEEDED(hr))
454  {
455  WARN("Can't get context menu for item\n");
456  DestroyMenu(treeMenu);
457  goto Cleanup;
458  }
460  x, y, 0, m_hWnd, NULL);
461 
462  ExecuteCommand(contextMenu, uCommand);
463 
464 Cleanup:
465  if (contextMenu)
466  IUnknown_SetSite(contextMenu, NULL);
467  if (treeMenu)
468  DestroyMenu(treeMenu);
472  return TRUE;
473 }
474 
476 {
477  bHandled = FALSE;
478  if (uMsg == WM_RBUTTONDOWN)
479  {
481  info.pt.x = LOWORD(lParam);
482  info.pt.y = HIWORD(lParam);
483  info.flags = TVHT_ONITEM;
484  info.hItem = NULL;
485 
486  // Save the current location
488 
489  // Move to the item selected by the treeview (don't change right pane)
490  TreeView_HitTest(m_hWnd, &info);
492  TreeView_SelectItem(m_hWnd, info.hItem);
494  }
495  return FALSE; /* let the wndproc process the message */
496 }
497 
499 {
501  LPITEMIDLIST clean;
502  HTREEITEM pItem;
503 
505  /* TODO: handle shell notifications */
506  switch(lParam & ~SHCNE_INTERRUPT)
507  {
508  case SHCNE_MKDIR:
509  if (!SUCCEEDED(_ReparsePIDL(dest[0], &clean)))
510  {
511  ERR("Can't reparse PIDL to a valid one\n");
512  return FALSE;
513  }
514  NavigateToPIDL(clean, &pItem, FALSE, TRUE, FALSE);
515  ILFree(clean);
516  break;
517  case SHCNE_RMDIR:
518  DeleteItem(dest[0]);
519  break;
520  case SHCNE_RENAMEFOLDER:
521  if (!SUCCEEDED(_ReparsePIDL(dest[1], &clean)))
522  {
523  ERR("Can't reparse PIDL to a valid one\n");
524  return FALSE;
525  }
526  if (NavigateToPIDL(dest[0], &pItem, FALSE, FALSE, FALSE))
527  RenameItem(pItem, clean);
528  ILFree(clean);
529  break;
530  case SHCNE_UPDATEDIR:
531  // We don't take care of this message
532  TRACE("Directory updated\n");
533  break;
534  default:
535  TRACE("Unhandled message\n");
536  }
537  return TRUE;
538 }
539 
541 {
542  m_bFocused = TRUE;
543  IUnknown_OnFocusChangeIS(m_pSite, reinterpret_cast<IUnknown*>(this), TRUE);
544  bHandled = FALSE;
545  return TRUE;
546 }
547 
549 {
550  IUnknown_OnFocusChangeIS(m_pSite, reinterpret_cast<IUnknown*>(this), FALSE);
551  bHandled = FALSE;
552  return TRUE;
553 }
554 
555 // *** Helper functions ***
557 {
558  TV_INSERTSTRUCT tvInsert;
559  HTREEITEM htiCreated;
560 
561  /* Get the attributes of the node */
562  SFGAOF attrs = SFGAO_STREAM | SFGAO_HASSUBFOLDER;
563  HRESULT hr = psfParent->GetAttributesOf(1, &pEltRelative, &attrs);
564  if (FAILED_UNEXPECTEDLY(hr))
565  return NULL;
566 
567  /* Ignore streams */
568  if ((attrs & SFGAO_STREAM))
569  {
570  TRACE("Ignoring stream\n");
571  return NULL;
572  }
573 
574  /* Get the name of the node */
575  WCHAR wszDisplayName[MAX_PATH];
576  STRRET strret;
577  hr = psfParent->GetDisplayNameOf(pEltRelative, SHGDN_INFOLDER, &strret);
578  if (FAILED_UNEXPECTEDLY(hr))
579  return NULL;
580 
581  hr = StrRetToBufW(&strret, pEltRelative, wszDisplayName, MAX_PATH);
582  if (FAILED_UNEXPECTEDLY(hr))
583  return NULL;
584 
585  /* Get the icon of the node */
586  INT iIcon = SHMapPIDLToSystemImageListIndex(psfParent, pEltRelative, NULL);
587 
588  NodeInfo* pChildInfo = new NodeInfo;
589  if (!pChildInfo)
590  {
591  ERR("Failed to allocate NodeInfo\n");
592  return FALSE;
593  }
594 
595  // Store our node info
596  pChildInfo->absolutePidl = ILClone(pElt);
597  pChildInfo->relativePidl = ILClone(pEltRelative);
598  pChildInfo->expanded = FALSE;
599 
600  // Set up our treeview template
601  tvInsert.hParent = hParent;
602  tvInsert.hInsertAfter = TVI_LAST;
603  tvInsert.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
604  tvInsert.item.cchTextMax = MAX_PATH;
605  tvInsert.item.pszText = wszDisplayName;
606  tvInsert.item.iImage = tvInsert.item.iSelectedImage = iIcon;
607  tvInsert.item.cChildren = (attrs & SFGAO_HASSUBFOLDER) ? 1 : 0;
608  tvInsert.item.lParam = (LPARAM)pChildInfo;
609 
610  htiCreated = TreeView_InsertItem(m_hWnd, &tvInsert);
611 
612  if (bSort)
613  {
614  TVSORTCB sortCallback;
615  sortCallback.hParent = hParent;
616  sortCallback.lpfnCompare = CompareTreeItems;
617  sortCallback.lParam = (LPARAM)this;
618  SendMessage(TVM_SORTCHILDRENCB, 0, (LPARAM)&sortCallback);
619  }
620 
621  return htiCreated;
622 }
623 
624 /* This is the slow version of the above method */
626 {
627  CComPtr<IShellFolder> psfFolder;
628  HRESULT hr = SHBindToParent(pElt, IID_PPV_ARG(IShellFolder, &psfFolder), NULL);
629  if (FAILED_UNEXPECTEDLY(hr))
630  return NULL;
631 
632  return InsertItem(hParent, psfFolder, pElt, pEltRelative, bSort);
633 }
634 
636 {
637  CComPtr<IEnumIDList> pEnumIDList;
638  LPITEMIDLIST pidlSub;
640  SHCONTF EnumFlags;
641  HRESULT hr;
642  ULONG fetched;
643  ULONG uItemCount;
644  CComPtr<IShellFolder> pFolder;
645  TVSORTCB sortCallback;
646 
647  entry = pNodeInfo->absolutePidl;
648  fetched = 1;
649  uItemCount = 0;
650  EnumFlags = SHCONTF_FOLDERS;
651 
652  hr = SHGetFolderLocation(m_hWnd, CSIDL_DESKTOP, NULL, 0, &pidlSub);
653  if (!SUCCEEDED(hr))
654  {
655  ERR("Can't get desktop PIDL !\n");
656  return FALSE;
657  }
658 
659  if (!m_pDesktop->CompareIDs(NULL, pidlSub, entry))
660  {
661  // We are the desktop, so use pDesktop as pFolder
662  pFolder = m_pDesktop;
663  }
664  else
665  {
666  // Get an IShellFolder of our pidl
667  hr = m_pDesktop->BindToObject(entry, NULL, IID_PPV_ARG(IShellFolder, &pFolder));
668  if (!SUCCEEDED(hr))
669  {
670  ILFree(pidlSub);
671  ERR("Can't bind folder to desktop !\n");
672  return FALSE;
673  }
674  }
675  ILFree(pidlSub);
676 
677  // TODO: handle hidden folders according to settings !
678  EnumFlags |= SHCONTF_INCLUDEHIDDEN;
679 
680  // Enum through objects
681  hr = pFolder->EnumObjects(NULL,EnumFlags,&pEnumIDList);
682 
683  // avoid broken IShellFolder implementations that return null pointer with success
684  if (!SUCCEEDED(hr) || !pEnumIDList)
685  {
686  ERR("Can't enum the folder !\n");
687  return FALSE;
688  }
689 
690  /* Don't redraw while we add stuff into the tree */
692  while(SUCCEEDED(pEnumIDList->Next(1, &pidlSub, &fetched)) && pidlSub && fetched)
693  {
694  LPITEMIDLIST pidlSubComplete;
695  pidlSubComplete = ILCombine(entry, pidlSub);
696 
697  if (InsertItem(hItem, pFolder, pidlSubComplete, pidlSub, FALSE))
698  uItemCount++;
699  ILFree(pidlSubComplete);
700  ILFree(pidlSub);
701  }
702  pNodeInfo->expanded = TRUE;
703  /* Let's do sorting */
704  sortCallback.hParent = hItem;
705  sortCallback.lpfnCompare = CompareTreeItems;
706  sortCallback.lParam = (LPARAM)this;
707  SendMessage(TVM_SORTCHILDRENCB, 0, (LPARAM)&sortCallback);
708 
709  /* Now we can redraw */
711 
712  return (uItemCount > 0) ? TRUE : FALSE;
713 }
714 
724  BOOL bSelect)
725 {
727  HTREEITEM tmp;
729  BOOL found;
730  NodeInfo *nodeData;
731  LPITEMIDLIST relativeChild;
732  TVITEM tvItem;
733 
734  if (!item)
735  return FALSE;
736 
737  found = FALSE;
738  current = m_hRoot;
739  parent = NULL;
740  while(!found)
741  {
742  nodeData = GetNodeInfo(current);
743  if (!nodeData)
744  {
745  ERR("Something has gone wrong, no data associated to node !\n");
746  *item = NULL;
747  return FALSE;
748  }
749  // If we found our node, give it back
750  if (!m_pDesktop->CompareIDs(0, nodeData->absolutePidl, dest))
751  {
752  if (bSelect)
753  TreeView_SelectItem(m_hWnd, current);
754  *item = current;
755  return TRUE;
756  }
757 
758  // Check if we are a parent of the requested item
759  relativeChild = ILFindChild(nodeData->absolutePidl, dest);
760  if (relativeChild != 0)
761  {
762  // Notify treeview we have children
763  tvItem.mask = TVIF_CHILDREN;
764  tvItem.hItem = current;
765  tvItem.cChildren = 1;
766  TreeView_SetItem(m_hWnd, &tvItem);
767 
768  // If we can expand and the node isn't expanded yet, do it
769  if (bExpand)
770  {
771  if (!nodeData->expanded)
772  InsertSubitems(current, nodeData);
774  }
775 
776  // Try to get a child
777  tmp = TreeView_GetChild(m_hWnd, current);
778  if (tmp)
779  {
780  // We have a child, let's continue with it
781  parent = current;
782  current = tmp;
783  continue;
784  }
785 
786  if (bInsert && nodeData->expanded)
787  {
788  // Happens when we have to create a subchild inside a child
789  current = InsertItem(current, dest, relativeChild, TRUE);
790  }
791  // We end up here, without any children, so we found nothing
792  // Tell the parent node it has children
793  ZeroMemory(&tvItem, sizeof(tvItem));
794  *item = NULL;
795  return FALSE;
796  }
797 
798  // Find sibling
799  tmp = TreeView_GetNextSibling(m_hWnd, current);
800  if (tmp)
801  {
802  current = tmp;
803  continue;
804  }
805  if (bInsert)
806  {
808  *item = current;
809  return TRUE;
810  }
811  *item = NULL;
812  return FALSE;
813  }
814  return FALSE;
815 }
816 
818 {
819  LPITEMIDLIST explorerPidl;
820  CComPtr<IBrowserService> pBrowserService;
821  HRESULT hr;
823  BOOL result;
824  explorerPidl = NULL;
825 
826  hr = IUnknown_QueryService(m_pSite, SID_STopLevelBrowser, IID_PPV_ARG(IBrowserService, &pBrowserService));
827  if (!SUCCEEDED(hr))
828  {
829  ERR("Can't get IBrowserService !\n");
830  return FALSE;
831  }
832 
833  hr = pBrowserService->GetPidl(&explorerPidl);
834  if (!SUCCEEDED(hr) || !explorerPidl)
835  {
836  ERR("Unable to get browser PIDL !\n");
837  return FALSE;
838  }
840  /* find PIDL into our explorer */
841  result = NavigateToPIDL(explorerPidl, &dummy, TRUE, FALSE, TRUE);
843  return result;
844 }
845 
847 {
848  HTREEITEM toDelete;
849  TVITEM tvItem;
850  HTREEITEM parentNode;
851 
852  if (!NavigateToPIDL(idl, &toDelete, FALSE, FALSE, FALSE))
853  return FALSE;
854 
855  // TODO: check that the treeview item is really deleted
856 
857  parentNode = TreeView_GetParent(m_hWnd, toDelete);
858  // Navigate to parent when deleting child item
859  if (!m_pDesktop->CompareIDs(0, idl, m_pidlCurrent))
860  {
861  TreeView_SelectItem(m_hWnd, parentNode);
862  }
863 
864  // Remove the child item
865  TreeView_DeleteItem(m_hWnd, toDelete);
866  // Probe parent to see if it has children
867  if (!TreeView_GetChild(m_hWnd, parentNode))
868  {
869  // Decrement parent's child count
870  ZeroMemory(&tvItem, sizeof(tvItem));
871  tvItem.mask = TVIF_CHILDREN;
872  tvItem.hItem = parentNode;
873  tvItem.cChildren = 0;
874  TreeView_SetItem(m_hWnd, &tvItem);
875  }
876  return TRUE;
877 }
878 
880 {
881  WCHAR wszDisplayName[MAX_PATH];
882  TVITEM itemInfo;
883  LPCITEMIDLIST relPidl;
884  NodeInfo *treeInfo;
885  TVSORTCB sortCallback;
887 
888  ZeroMemory(&itemInfo, sizeof(itemInfo));
889  itemInfo.mask = TVIF_PARAM;
890  itemInfo.hItem = toRename;
891 
892  // Change PIDL associated to the item
893  relPidl = ILFindLastID(newPidl);
894  TreeView_GetItem(m_hWnd, &itemInfo);
895  if (!itemInfo.lParam)
896  {
897  ERR("Unable to fetch lParam\n");
898  return FALSE;
899  }
901  treeInfo = (NodeInfo*)itemInfo.lParam;
902  ILFree(treeInfo->absolutePidl);
903  ILFree(treeInfo->relativePidl);
904  treeInfo->absolutePidl = ILClone(newPidl);
905  treeInfo->relativePidl = ILClone(relPidl);
906 
907  // Change the display name
908  GetDisplayName(newPidl, wszDisplayName, MAX_PATH, SHGDN_INFOLDER);
909  ZeroMemory(&itemInfo, sizeof(itemInfo));
910  itemInfo.hItem = toRename;
911  itemInfo.mask = TVIF_TEXT;
912  itemInfo.pszText = wszDisplayName;
913  TreeView_SetItem(m_hWnd, &itemInfo);
914 
915  if((child = TreeView_GetChild(m_hWnd, toRename)) != NULL)
916  {
917  RefreshTreePidl(child, newPidl);
918  }
919 
920  // Sorting
921  sortCallback.hParent = TreeView_GetParent(m_hWnd, toRename);
922  sortCallback.lpfnCompare = CompareTreeItems;
923  sortCallback.lParam = (LPARAM)this;
924  SendMessage(TVM_SORTCHILDRENCB, 0, (LPARAM)&sortCallback);
926  return TRUE;
927 }
928 
930 {
931  HTREEITEM tmp;
932  NodeInfo *pInfo;
933 
934  // Update our node data
935  pInfo = GetNodeInfo(tree);
936  if (!pInfo)
937  {
938  WARN("No tree info !\n");
939  return FALSE;
940  }
941  ILFree(pInfo->absolutePidl);
942  pInfo->absolutePidl = ILCombine(pidlParent, pInfo->relativePidl);
943  if (!pInfo->absolutePidl)
944  {
945  WARN("PIDL allocation failed\n");
946  return FALSE;
947  }
948  // Recursively update children
949  if ((tmp = TreeView_GetChild(m_hWnd, tree)) != NULL)
950  {
951  RefreshTreePidl(tmp, pInfo->absolutePidl);
952  }
953 
954  tmp = TreeView_GetNextSibling(m_hWnd, tree);
955  while(tmp != NULL)
956  {
957  pInfo = GetNodeInfo(tmp);
958  if(!pInfo)
959  {
960  WARN("No tree info !\n");
961  continue;
962  }
963  ILFree(pInfo->absolutePidl);
964  pInfo->absolutePidl = ILCombine(pidlParent, pInfo->relativePidl);
965  tmp = TreeView_GetNextSibling(m_hWnd, tmp);
966  }
967  return TRUE;
968 }
969 
970 // *** Tree item sorting callback ***
972 {
973  /*
974  * We first sort drive letters (Path root), then PIDLs and then regular folder
975  * display name.
976  * This is not how Windows sorts item, but it gives decent results.
977  */
978  NodeInfo *info1;
979  NodeInfo *info2;
980  CExplorerBand *pThis;
981  WCHAR wszFolder1[MAX_PATH];
982  WCHAR wszFolder2[MAX_PATH];
983 
984  info1 = (NodeInfo*)p1;
985  info2 = (NodeInfo*)p2;
986  pThis = (CExplorerBand*)p3;
987 
988  GetDisplayName(info1->absolutePidl, wszFolder1, MAX_PATH, SHGDN_FORPARSING);
989  GetDisplayName(info2->absolutePidl, wszFolder2, MAX_PATH, SHGDN_FORPARSING);
990  if (PathIsRoot(wszFolder1) && PathIsRoot(wszFolder2))
991  {
992  return lstrcmpiW(wszFolder1,wszFolder2);
993  }
994  if (PathIsRoot(wszFolder1) && !PathIsRoot(wszFolder2))
995  {
996  return -1;
997  }
998  if (!PathIsRoot(wszFolder1) && PathIsRoot(wszFolder2))
999  {
1000  return 1;
1001  }
1002  // Now, we compare non-root folders, grab display name
1003  GetDisplayName(info1->absolutePidl, wszFolder1, MAX_PATH, SHGDN_INFOLDER);
1004  GetDisplayName(info2->absolutePidl, wszFolder2, MAX_PATH, SHGDN_INFOLDER);
1005 
1007  {
1008  return -1;
1009  }
1011  {
1012  return 1;
1013  }
1015  {
1016  HRESULT hr;
1017  hr = pThis->m_pDesktop->CompareIDs(0, info1->absolutePidl, info2->absolutePidl);
1018  if (!hr) return 0;
1019  return (hr > 0) ? -1 : 1;
1020  }
1021  return StrCmpLogicalW(wszFolder1, wszFolder2);
1022 }
1023 
1024 // *** IOleWindow methods ***
1026 {
1027  if (!lphwnd)
1028  return E_INVALIDARG;
1029  *lphwnd = m_hWnd;
1030  return S_OK;
1031 }
1032 
1034 {
1035  UNIMPLEMENTED;
1036  return E_NOTIMPL;
1037 }
1038 
1039 
1040 // *** IDockingWindow methods ***
1042 {
1043  // We do nothing, we don't have anything to save yet
1044  TRACE("CloseDW called\n");
1045  return S_OK;
1046 }
1047 
1048 HRESULT STDMETHODCALLTYPE CExplorerBand::ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
1049 {
1050  /* Must return E_NOTIMPL according to MSDN */
1051  return E_NOTIMPL;
1052 }
1053 
1055 {
1056  m_fVisible = fShow;
1057  ShowWindow(fShow);
1058  return S_OK;
1059 }
1060 
1061 
1062 // *** IDeskBand methods ***
1064 {
1065  if (!pdbi)
1066  {
1067  return E_INVALIDARG;
1068  }
1069  this->m_dwBandID = dwBandID;
1070 
1071  if (pdbi->dwMask & DBIM_MINSIZE)
1072  {
1073  pdbi->ptMinSize.x = 200;
1074  pdbi->ptMinSize.y = 30;
1075  }
1076 
1077  if (pdbi->dwMask & DBIM_MAXSIZE)
1078  {
1079  pdbi->ptMaxSize.y = -1;
1080  }
1081 
1082  if (pdbi->dwMask & DBIM_INTEGRAL)
1083  {
1084  pdbi->ptIntegral.y = 1;
1085  }
1086 
1087  if (pdbi->dwMask & DBIM_ACTUAL)
1088  {
1089  pdbi->ptActual.x = 200;
1090  pdbi->ptActual.y = 30;
1091  }
1092 
1093  if (pdbi->dwMask & DBIM_TITLE)
1094  {
1095  if (!LoadStringW(_AtlBaseModule.GetResourceInstance(), IDS_FOLDERSLABEL, pdbi->wszTitle, _countof(pdbi->wszTitle)))
1096  return HRESULT_FROM_WIN32(GetLastError());
1097  }
1098 
1099  if (pdbi->dwMask & DBIM_MODEFLAGS)
1100  {
1101  pdbi->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT;
1102  }
1103 
1104  if (pdbi->dwMask & DBIM_BKCOLOR)
1105  {
1106  pdbi->dwMask &= ~DBIM_BKCOLOR;
1107  }
1108  return S_OK;
1109 }
1110 
1111 
1112 // *** IObjectWithSite methods ***
1114 {
1115  HRESULT hr;
1116  HWND parentWnd;
1117 
1118  if (pUnkSite == m_pSite)
1119  return S_OK;
1120 
1121  TRACE("SetSite called \n");
1122  if (!pUnkSite)
1123  {
1125  DestroyWindow();
1126  m_hWnd = NULL;
1127  }
1128 
1129  if (pUnkSite != m_pSite)
1130  {
1131  m_pSite = NULL;
1132  }
1133 
1134  if(!pUnkSite)
1135  return S_OK;
1136 
1137  hr = IUnknown_GetWindow(pUnkSite, &parentWnd);
1138  if (!SUCCEEDED(hr))
1139  {
1140  ERR("Could not get parent's window ! Status: %08lx\n", hr);
1141  return E_INVALIDARG;
1142  }
1143 
1144  m_pSite = pUnkSite;
1145 
1146  if (m_hWnd)
1147  {
1148  // Change its parent
1149  SetParent(parentWnd);
1150  }
1151  else
1152  {
1154  WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TVS_HASLINES | TVS_HASBUTTONS | TVS_SHOWSELALWAYS | TVS_EDITLABELS /* | TVS_SINGLEEXPAND*/ , // remove TVS_SINGLEEXPAND for now since it has strange behaviour
1155  0, 0, 0, 0, parentWnd, NULL, _AtlBaseModule.GetModuleInstance(), NULL);
1156 
1157  // Subclass the window
1158  SubclassWindow(wnd);
1159 
1160  // Initialize our treeview now
1162  RegisterDragDrop(m_hWnd, dynamic_cast<IDropTarget*>(this));
1163  }
1164  return S_OK;
1165 }
1166 
1168 {
1169  if (!ppvSite)
1170  return E_POINTER;
1171  *ppvSite = m_pSite;
1172  return S_OK;
1173 }
1174 
1175 
1176 // *** IOleCommandTarget methods ***
1177 HRESULT STDMETHODCALLTYPE CExplorerBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
1178 {
1179  UNIMPLEMENTED;
1180  return E_NOTIMPL;
1181 }
1182 
1183 HRESULT STDMETHODCALLTYPE CExplorerBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
1184 {
1185  UNIMPLEMENTED;
1186  return E_NOTIMPL;
1187 }
1188 
1189 
1190 // *** IServiceProvider methods ***
1192 {
1193  /* FIXME: we probably want to handle more services here */
1195 }
1196 
1197 
1198 // *** IInputObject methods ***
1200 {
1201  if (fActivate)
1202  {
1203  //SetFocus();
1204  SetActiveWindow();
1205  }
1206  // TODO: handle message
1207  if(lpMsg)
1208  {
1209  TranslateMessage(lpMsg);
1210  DispatchMessage(lpMsg);
1211  }
1212  return S_OK;
1213 }
1214 
1216 {
1217  return m_bFocused ? S_OK : S_FALSE;
1218 }
1219 
1221 {
1222  if (lpMsg->hwnd == m_hWnd)
1223  {
1224  TranslateMessage(lpMsg);
1225  DispatchMessage(lpMsg);
1226  return S_OK;
1227  }
1228 
1229  return S_FALSE;
1230 }
1231 
1232 // *** IPersist methods ***
1234 {
1235  if (!pClassID)
1236  return E_POINTER;
1237  memcpy(pClassID, &CLSID_ExplorerBand, sizeof(CLSID));
1238  return S_OK;
1239 }
1240 
1241 
1242 // *** IPersistStream methods ***
1244 {
1245  UNIMPLEMENTED;
1246  return E_NOTIMPL;
1247 }
1248 
1250 {
1251  UNIMPLEMENTED;
1252  return E_NOTIMPL;
1253 }
1254 
1256 {
1257  UNIMPLEMENTED;
1258  return E_NOTIMPL;
1259 }
1260 
1262 {
1263  // TODO: calculate max size
1264  UNIMPLEMENTED;
1265  return E_NOTIMPL;
1266 }
1267 
1268 
1269 // *** IWinEventHandler methods ***
1271 {
1272  BOOL bHandled;
1273  LRESULT result;
1274 
1275  if (uMsg == WM_NOTIFY)
1276  {
1277  NMHDR *pNotifyHeader = (NMHDR*)lParam;
1278  switch (pNotifyHeader->code)
1279  {
1280  case TVN_ITEMEXPANDING:
1282  if (theResult)
1283  *theResult = result;
1284  break;
1285  case TVN_SELCHANGED:
1287  break;
1288  case TVN_DELETEITEM:
1290  break;
1291  case NM_RCLICK:
1292  OnContextMenu(WM_CONTEXTMENU, (WPARAM)m_hWnd, GetMessagePos(), bHandled);
1293  if (theResult)
1294  *theResult = 1;
1295  break;
1296  case TVN_BEGINDRAG:
1297  case TVN_BEGINRDRAG:
1299  case TVN_BEGINLABELEDITW:
1300  {
1301  // TODO: put this in a function ? (mostly copypasta from CDefView)
1302  DWORD dwAttr = SFGAO_CANRENAME;
1303  LPNMTVDISPINFO dispInfo = (LPNMTVDISPINFO)lParam;
1304  CComPtr<IShellFolder> pParent;
1305  LPCITEMIDLIST pChild;
1306  HRESULT hr;
1307 
1308  if (theResult)
1309  *theResult = 1;
1310  NodeInfo *info = GetNodeInfo(dispInfo->item.hItem);
1311  if (!info)
1312  return E_FAIL;
1313  hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pParent), &pChild);
1314  if (!SUCCEEDED(hr) || !pParent.p)
1315  return E_FAIL;
1316 
1317  hr = pParent->GetAttributesOf(1, &pChild, &dwAttr);
1318  if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME) && theResult)
1319  *theResult = 0;
1320  return S_OK;
1321  }
1322  case TVN_ENDLABELEDITW:
1323  {
1324  LPNMTVDISPINFO dispInfo = (LPNMTVDISPINFO)lParam;
1325  NodeInfo *info = GetNodeInfo(dispInfo->item.hItem);
1326  HRESULT hr;
1327 
1328  if (theResult)
1329  *theResult = 0;
1330  if (dispInfo->item.pszText)
1331  {
1332  LPITEMIDLIST pidlNew;
1333  CComPtr<IShellFolder> pParent;
1334  LPCITEMIDLIST pidlChild;
1335 
1336  hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pParent), &pidlChild);
1337  if (!SUCCEEDED(hr) || !pParent.p)
1338  return E_FAIL;
1339 
1340  hr = pParent->SetNameOf(0, pidlChild, dispInfo->item.pszText, SHGDN_INFOLDER, &pidlNew);
1341  if(SUCCEEDED(hr) && pidlNew)
1342  {
1343  CComPtr<IPersistFolder2> pPersist;
1344  LPITEMIDLIST pidlParent, pidlNewAbs;
1345 
1346  hr = pParent->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pPersist));
1347  if(!SUCCEEDED(hr))
1348  return E_FAIL;
1349 
1350  hr = pPersist->GetCurFolder(&pidlParent);
1351  if(!SUCCEEDED(hr))
1352  return E_FAIL;
1353  pidlNewAbs = ILCombine(pidlParent, pidlNew);
1354 
1355  // Navigate to our new location
1356  UpdateBrowser(pidlNewAbs);
1357 
1358  ILFree(pidlParent);
1359  ILFree(pidlNewAbs);
1360  ILFree(pidlNew);
1361  if (theResult)
1362  *theResult = 1;
1363  }
1364  return S_OK;
1365  }
1366  }
1367  default:
1368  break;
1369  }
1370  }
1371  return S_OK;
1372 }
1373 
1375 {
1376  return (hWnd == m_hWnd) ? S_OK : S_FALSE;
1377 }
1378 
1379 // *** IBandNavigate methods ***
1381 {
1382  UNIMPLEMENTED;
1383  return E_NOTIMPL;
1384 }
1385 
1386 // *** INamespaceProxy ***
1387 HRESULT STDMETHODCALLTYPE CExplorerBand::GetNavigateTarget(long paramC, long param10, long param14)
1388 {
1389  UNIMPLEMENTED;
1390  return E_NOTIMPL;
1391 }
1392 
1394 {
1395  UNIMPLEMENTED;
1396  return E_NOTIMPL;
1397 }
1398 
1400 {
1401  UNIMPLEMENTED;
1402  return E_NOTIMPL;
1403 }
1404 
1405 HRESULT STDMETHODCALLTYPE CExplorerBand::RefreshFlags(long paramC, long param10, long param14)
1406 {
1407  UNIMPLEMENTED;
1408  return E_NOTIMPL;
1409 }
1410 
1412 {
1413  UNIMPLEMENTED;
1414  return E_NOTIMPL;
1415 }
1416 
1417 // *** IDispatch methods ***
1419 {
1420  UNIMPLEMENTED;
1421  return E_NOTIMPL;
1422 }
1423 
1425 {
1426  UNIMPLEMENTED;
1427  return E_NOTIMPL;
1428 }
1429 
1431 {
1432  UNIMPLEMENTED;
1433  return E_NOTIMPL;
1434 }
1435 
1436 HRESULT STDMETHODCALLTYPE CExplorerBand::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1437 {
1438  switch (dispIdMember)
1439  {
1442  TRACE("DISPID_NAVIGATECOMPLETE2 received\n");
1444  return S_OK;
1445  }
1446  TRACE("Unknown dispid requested: %08x\n", dispIdMember);
1447  return E_INVALIDARG;
1448 }
1449 
1450 // *** IDropTarget methods ***
1452 {
1453  ERR("Entering drag\n");
1454  m_pCurObject = pObj;
1456  return DragOver(glfKeyState, pt, pdwEffect);
1457 }
1458 
1460 {
1462  CComPtr<IShellFolder> pShellFldr;
1463  NodeInfo *nodeInfo;
1464  //LPCITEMIDLIST pChild;
1465  HRESULT hr;
1466 
1467  info.pt.x = pt.x;
1468  info.pt.y = pt.y;
1469  info.flags = TVHT_ONITEM;
1470  info.hItem = NULL;
1471  ScreenToClient(&info.pt);
1472 
1473  // Move to the item selected by the treeview (don't change right pane)
1474  TreeView_HitTest(m_hWnd, &info);
1475 
1476  if (info.hItem)
1477  {
1478  m_bNavigating = TRUE;
1479  TreeView_SelectItem(m_hWnd, info.hItem);
1480  m_bNavigating = FALSE;
1481  // Delegate to shell folder
1482  if (m_pDropTarget && info.hItem != m_childTargetNode)
1483  {
1484  m_pDropTarget = NULL;
1485  }
1486  if (info.hItem != m_childTargetNode)
1487  {
1488  nodeInfo = GetNodeInfo(info.hItem);
1489  if (!nodeInfo)
1490  return E_FAIL;
1491 #if 0
1492  hr = SHBindToParent(nodeInfo->absolutePidl, IID_PPV_ARG(IShellFolder, &pShellFldr), &pChild);
1493  if (!SUCCEEDED(hr))
1494  return E_FAIL;
1495  hr = pShellFldr->GetUIObjectOf(m_hWnd, 1, &pChild, IID_IDropTarget, NULL, reinterpret_cast<void**>(&pDropTarget));
1496  if (!SUCCEEDED(hr))
1497  return E_FAIL;
1498 #endif
1499  if(_ILIsDesktop(nodeInfo->absolutePidl))
1500  pShellFldr = m_pDesktop;
1501  else
1502  {
1503  hr = m_pDesktop->BindToObject(nodeInfo->absolutePidl, 0, IID_PPV_ARG(IShellFolder, &pShellFldr));
1504  if (!SUCCEEDED(hr))
1505  {
1506  /* Don't allow dnd since we couldn't get our folder object */
1507  ERR("Can't bind to folder object\n");
1508  *pdwEffect = DROPEFFECT_NONE;
1509  return E_FAIL;
1510  }
1511  }
1512  hr = pShellFldr->CreateViewObject(m_hWnd, IID_PPV_ARG(IDropTarget, &m_pDropTarget));
1513  if (!SUCCEEDED(hr))
1514  {
1515  /* Don't allow dnd since we couldn't get our drop target */
1516  ERR("Can't get drop target for folder object\n");
1517  *pdwEffect = DROPEFFECT_NONE;
1518  return E_FAIL;
1519  }
1520  hr = m_pDropTarget->DragEnter(m_pCurObject, glfKeyState, pt, pdwEffect);
1521  m_childTargetNode = info.hItem;
1522  }
1523  if (m_pDropTarget)
1524  {
1525  hr = m_pDropTarget->DragOver(glfKeyState, pt, pdwEffect);
1526  }
1527  }
1528  else
1529  {
1531  m_pDropTarget = NULL;
1532  *pdwEffect = DROPEFFECT_NONE;
1533  }
1534  return S_OK;
1535 }
1536 
1538 {
1539  m_bNavigating = TRUE;
1541  m_bNavigating = FALSE;
1543  if (m_pCurObject)
1544  {
1545  m_pCurObject = NULL;
1546  }
1547  return S_OK;
1548 }
1549 
1551 {
1552  if (!m_pDropTarget)
1553  return E_FAIL;
1554  m_pDropTarget->Drop(pObj, glfKeyState, pt, pdwEffect);
1555  DragLeave();
1556  return S_OK;
1557 }
1558 
1559 // *** IDropSource methods ***
1561 {
1562  if (fEscapePressed)
1563  return DRAGDROP_S_CANCEL;
1564  if ((grfKeyState & MK_LBUTTON) || (grfKeyState & MK_RBUTTON))
1565  return S_OK;
1566  return DRAGDROP_S_DROP;
1567 }
1568 
1570 {
1572 }
DBIM_BKCOLOR struct tagDESKBANDINFO DESKBANDINFO
LPITEMIDLIST relativePidl
Definition: explorerband.h:50
#define SHCNE_MKDIR
Definition: shlobj.h:1732
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
return
Definition: dirsup.c:529
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL OnTreeItemDeleted(LPNMTREEVIEW pnmtv)
BOOL NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExpand, BOOL bInsert, BOOL bSelect)
virtual HRESULT STDMETHODCALLTYPE GetNavigateTarget(long paramC, long param10, long param14)
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
#define SHCNE_RMDIR
Definition: shlobj.h:1733
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
Definition: fci.c:115
#define SHCNE_DISKEVENTS
Definition: shlobj.h:1751
DWORD m_adviseCookie
Definition: explorerband.h:69
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define CreateWindow
Definition: winuser.h:5729
HRESULT hr
Definition: shlfolder.c:183
Definition: scsiwmi.h:51
#define MK_LBUTTON
Definition: winuser.h:2342
HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw)
Definition: atl.c:45
void OnSelectionChanged(LPNMTREEVIEW pnmtv)
#define TreeView_DeleteAllItems(hwnd)
Definition: commctrl.h:3413
HTREEITEM m_oldSelected
Definition: explorerband.h:65
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
#define CSIDL_DESKTOP
Definition: shlobj.h:2012
virtual HRESULT STDMETHODCALLTYPE DragEnter(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect)
#define pt(x, y)
Definition: drawing.c:79
#define TPM_LEFTALIGN
Definition: winuser.h:2352
LPITEMIDLIST m_pidlCurrent
Definition: explorerband.h:66
REFIID riid
Definition: precomp.h:44
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
#define TVM_SORTCHILDRENCB
Definition: commctrl.h:3543
#define TPM_RETURNCMD
Definition: winuser.h:2362
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1522
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
virtual HRESULT STDMETHODCALLTYPE QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm)
#define TreeView_GetChild(hwnd, hitem)
Definition: commctrl.h:3462
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4652
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg)
NodeInfo * GetNodeInfo(HTREEITEM hItem)
virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite)
#define WARN(fmt,...)
Definition: debug.h:112
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
#define SHCNE_RENAMEFOLDER
Definition: shlobj.h:1746
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define CALLBACK
Definition: compat.h:27
#define WM_SETREDRAW
Definition: winuser.h:1598
#define SHCNE_INTERRUPT
Definition: shlobj.h:1754
HWND hWnd
Definition: settings.c:17
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID)
#define LPNMTREEVIEW
Definition: commctrl.h:3639
DWORD m_dwBandID
Definition: explorerband.h:62
virtual HRESULT STDMETHODCALLTYPE Select(long paramC)
#define DISPID_DOWNLOADCOMPLETE
Definition: webchild.h:39
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1648
CComPtr< IShellFolder > m_pDesktop
Definition: explorerband.h:56
HRESULT _ReparsePIDL(LPITEMIDLIST buggyPidl, LPITEMIDLIST *cleanPidl)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define FCIDM_SHVIEWFIRST
Definition: shlobj.h:507
HWND WINAPI SetFocus(_In_opt_ HWND)
const GUID IID_IDataObject
HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
Definition: ole2.c:557
static int CALLBACK CompareTreeItems(LPARAM p1, LPARAM p2, LPARAM p3)
#define SHCNRF_RecursiveInterrupt
Definition: shlobj.h:1776
DWORD LCID
Definition: nls.h:13
UINT_PTR WPARAM
Definition: windef.h:207
int cChildren
Definition: treeview.c:154
#define WS_CHILD
Definition: pedump.c:617
DWORD WINAPI GetMessagePos(void)
Definition: message.c:1351
#define TreeView_GetNextSibling(hwnd, hitem)
Definition: commctrl.h:3463
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3267
UINT uFlags
Definition: api.c:59
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL m_bNavigating
Definition: explorerband.h:60
#define WS_CLIPCHILDREN
Definition: pedump.c:619
static LPOLESTR
Definition: stg_prop.c:27
#define TVN_BEGINDRAG
Definition: commctrl.h:3736
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1329
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:57
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1494
HRESULT WINAPI RevokeDragDrop(HWND hwnd)
Definition: ole2.c:639
static HWND child
Definition: cursoricon.c:298
virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty)
WPARAM wParam
Definition: combotst.c:138
#define DRAGDROP_S_CANCEL
Definition: winerror.h:2647
HTREEITEM InsertItem(HTREEITEM hParent, IShellFolder *psfParent, LPITEMIDLIST pElt, LPITEMIDLIST pEltRelative, BOOL bSort)
HTREEITEM m_hRoot
Definition: explorerband.h:64
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
struct _test_info info[]
Definition: SetCursorPos.c:19
HRESULT GetDisplayNameOf([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
HRESULT ExecuteCommand(CComPtr< IContextMenu > &menu, UINT nCmd)
UINT code
Definition: winuser.h:3134
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd)
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3408
#define TVN_ENDLABELEDITW
Definition: commctrl.h:3708
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
#define TPM_RIGHTBUTTON
Definition: winuser.h:2355
BOOL OnTreeItemExpanding(LPNMTREEVIEW pnmtv)
virtual HRESULT STDMETHODCALLTYPE IsDirty()
#define WM_USER_SHELLEVENT
Definition: explorerband.h:24
#define TVIF_CHILDREN
Definition: commctrl.h:3268
HWND WINAPI SetActiveWindow(_In_ HWND)
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
BOOL RefreshTreePidl(HTREEITEM tree, LPITEMIDLIST pidlParent)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL NavigateToCurrentFolder()
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:517
BOOL DeleteItem(LPITEMIDLIST toDelete)
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
Definition: shellord.c:2315
#define StrRetToBuf
Definition: shlwapi.h:1769
HTREEITEM m_childTargetNode
Definition: explorerband.h:74
#define TVS_HASBUTTONS
Definition: commctrl.h:3243
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1404
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static PVOID ptr
Definition: dispmode.c:27
ULONG Release()
#define S_FALSE
Definition: winerror.h:2357
CComPtr< IUnknown > m_pSite
Definition: explorerband.h:55
#define TVN_BEGINRDRAG
Definition: commctrl.h:3737
#define VK_SHIFT
Definition: winuser.h:2177
#define E_INVALIDARG
Definition: ddrawi.h:101
HTREEITEM hItem
Definition: treelist.h:37
#define DISPID_NAVIGATECOMPLETE2
Definition: webchild.h:54
const WCHAR * str
HRESULT GetAttributesOf([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
#define SHCNRF_InterruptLevel
Definition: shlobj.h:1774
smooth NULL
Definition: ftsmooth.c:416
#define SID_SWebBrowserApp
Definition: shlguid.h:108
#define TVE_COLLAPSE
Definition: commctrl.h:3418
LPITEMIDLIST absolutePidl
Definition: explorerband.h:49
LONG_PTR LPARAM
Definition: windef.h:208
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:189
#define TVI_LAST
Definition: commctrl.h:3366
struct CFFOLDER folder
Definition: fdi.c:102
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3443
CComPtr< IDataObject > m_pCurObject
Definition: explorerband.h:75
#define MK_RBUTTON
Definition: winuser.h:2343
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
#define FCIDM_SHVIEWLAST
Definition: shlobj.h:541
#define WM_RBUTTONDOWN
Definition: winuser.h:1761
SHORT WINAPI GetKeyState(_In_ int)
virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg)
#define TreeView_DeleteItem(hwnd, hitem)
Definition: commctrl.h:3411
char TCHAR
Definition: xmlstorage.h:189
CComPtr< IDropTarget > m_pDropTarget
Definition: explorerband.h:73
#define PT_YAGUID
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
Definition: atl.c:73
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3469
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT UpdateBrowser(LPITEMIDLIST pidlGoto)
#define WC_TREEVIEW
Definition: commctrl.h:3241
r parent
Definition: btrfs.c:2944
#define TreeView_HitTest(hwnd, lpht)
Definition: commctrl.h:3509
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
#define _countof(array)
Definition: sndvol32.h:68
#define TVN_SELCHANGED
Definition: commctrl.h:3731
struct _PIDLDATA PIDLDATA
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:26
#define SHCNRF_ShellLevel
Definition: shlobj.h:1775
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DRAGDROP_S_USEDEFAULTCURSORS
Definition: winerror.h:2648
virtual HRESULT STDMETHODCALLTYPE DragLeave()
LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
virtual HRESULT STDMETHODCALLTYPE Drop(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect)
#define TVE_EXPAND
Definition: commctrl.h:3419
UINT cchMax
void InitializeExplorerBand()
virtual HRESULT STDMETHODCALLTYPE HasFocusIO()
virtual HRESULT STDMETHODCALLTYPE IsWindowOwner(HWND hWnd)
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
INT WINAPI StrCmpLogicalW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:2296
virtual HRESULT STDMETHODCALLTYPE CacheItem(long paramC)
#define IDS_FOLDERSLABEL
Definition: resource.h:124
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite)
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize)
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
uint32_t entry
Definition: isohybrid.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
PCIDLIST_ABSOLUTE pidl
Definition: shlobj.h:1725
#define TreeView_GetParent(hwnd, hitem)
Definition: commctrl.h:3465
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static const WCHAR Cleanup[]
Definition: register.c:80
virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD glfKeyState, POINTL pt, DWORD *pdwEffect)
#define TVN_BEGINLABELEDITW
Definition: commctrl.h:3706
void OnTreeItemDragging(LPNMTREEVIEW pnmtv, BOOL isRightClick)
unsigned char BYTE
Definition: xxhash.c:193
virtual HRESULT STDMETHODCALLTYPE Invoke(long paramC)
HRESULT GetDisplayName(LPCITEMIDLIST pidlDirectory, TCHAR *szDisplayName, UINT cchMax, DWORD uFlags)
virtual HRESULT STDMETHODCALLTYPE RefreshFlags(long paramC, long param10, long param14)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define TVIS_EXPANDED
Definition: commctrl.h:3280
HTREEITEM hParent
Definition: commctrl.h:3610
static BOOL bInsert
Definition: cmdinput.c:121
#define TVITEM
Definition: commctrl.h:3361
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
#define ERR(fmt,...)
Definition: debug.h:110
#define TVN_ITEMEXPANDING
Definition: commctrl.h:3734
PFNTVCOMPARE lpfnCompare
Definition: commctrl.h:3611
struct stdole::EXCEPINFO EXCEPINFO
virtual ~CExplorerBand()
#define TV_ITEM
Definition: commctrl.h:3296
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:59
LRESULT OnShellEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
static ATOM item
Definition: dde.c:856
virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi)
const DWORD DROPEFFECT_MOVE
Definition: oleidl.idl:931
BOOL InsertSubitems(HTREEITEM hItem, NodeInfo *pNodeInfo)
#define TVN_DELETEITEM
Definition: commctrl.h:3738
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1331
virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
#define TVIF_TEXT
Definition: commctrl.h:3262
unsigned char dummy
Definition: maze.c:118
PUIDLIST_RELATIVE WINAPI ILFindChild(PIDLIST_ABSOLUTE pidl1, PCIDLIST_ABSOLUTE pidl2)
Definition: pidl.c:641
#define NM_RCLICK
Definition: commctrl.h:133
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define TreeView_SelectItem(hwnd, hitem)
Definition: commctrl.h:3477
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
#define DRAGDROP_S_DROP
Definition: winerror.h:2646
ULONG m_shellRegID
Definition: explorerband.h:70
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT WINAPI DoDragDrop(IDataObject *pDataObject, IDropSource *pDropSource, DWORD dwOKEffect, DWORD *pdwEffect)
Definition: ole2.c:753
BOOL RenameItem(HTREEITEM toRename, LPITEMIDLIST newPidl)
virtual HRESULT STDMETHODCALLTYPE CloseDW(DWORD dwReserved)
virtual HRESULT STDMETHODCALLTYPE GiveFeedback(DWORD dwEffect)
#define TVIF_IMAGE
Definition: commctrl.h:3263
#define SHCNE_UPDATEDIR
Definition: shlobj.h:1741
unsigned int UINT
Definition: ndis.h:50
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
HWND hwnd
Definition: winuser.h:3089
#define TreeView_SetItem(hwnd, pitem)
Definition: commctrl.h:3493
#define LPNMTVDISPINFO
Definition: commctrl.h:3672
#define VK_CONTROL
Definition: winuser.h:2178
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3248
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
#define TVS_HASLINES
Definition: commctrl.h:3244
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
#define TVSIL_NORMAL
Definition: commctrl.h:3439
#define SendMessage
Definition: winuser.h:5818
int WINAPI SHMapPIDLToSystemImageListIndex(IShellFolder *sh, LPCITEMIDLIST pidl, int *pIndex)
Definition: iconcache.cpp:789
struct stdole::DISPPARAMS DISPPARAMS
#define TPM_LEFTBUTTON
Definition: winuser.h:2354
EXTERN_C ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, INT fSources, LONG wEventMask, UINT uMsg, INT cItems, SHChangeNotifyEntry *lpItems)
#define HIWORD(l)
Definition: typedefs.h:246
unsigned int ULONG
Definition: retypes.h:1
#define TVIF_STATE
Definition: commctrl.h:3265
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:2741
#define SHIL_SMALL
Definition: shellapi.h:183
static char * dest
Definition: rtl.c:135
#define TVIF_PARAM
Definition: commctrl.h:3264
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
#define SID_SShellBrowser
Definition: shlguid.h:125
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
LONG_PTR LRESULT
Definition: windef.h:209
#define E_POINTER
Definition: winerror.h:2365
#define TVHT_ONITEM
Definition: commctrl.h:3523
#define TV_INSERTSTRUCT
Definition: commctrl.h:3373
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3416
LPARAM lParam
Definition: commctrl.h:3612
GLuint64EXT * result
Definition: glext.h:11304
LRESULT ContextMenuHack(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
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
#define PT_GUID
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define LOWORD(l)
Definition: pedump.c:82
static SHCONTF
Definition: ordinal.c:61
#define UNIMPLEMENTED
#define PathIsRoot
Definition: shlwapi.h:955
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3486
#define WM_NOTIFY
Definition: richedit.h:61
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define TVS_EDITLABELS
Definition: commctrl.h:3246
struct task_struct * current
Definition: linux.c:32
void DestroyExplorerBand()
#define PT_SHELLEXT
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
struct _PIDLDATA * LPPIDLDATA