ReactOS 0.4.15-dev-8413-gc1c91f2
explorerband.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Explorer
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Explorer bar
5 * COPYRIGHT: Copyright 2016 Sylvain Deverre <deverre.sylv@gmail.com>
6 * Copyright 2020-2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7 */
8
9#include "precomp.h"
10#include <commoncontrols.h>
11#include <undocshell.h>
12#include "utility.h"
13
14#if 1
15#undef UNIMPLEMENTED
16
17#define UNIMPLEMENTED DbgPrint("%s is UNIMPLEMENTED!\n", __FUNCTION__)
18#endif
19
20/*
21 * TODO:
22 * - Monitor correctly "external" shell interrupts (seems like we need to register/deregister them for each folder)
23 * - find and fix what cause explorer crashes sometimes (seems to be explorer that does more releases than addref)
24 * - TESTING
25 */
26
27typedef struct _PIDLDATA
28{
32
33#define PT_GUID 0x1F
34#define PT_SHELLEXT 0x2E
35#define PT_YAGUID 0x70
36
38{
39 LPPIDLDATA lpPData = (LPPIDLDATA)&pidl->mkid.abID;
40
41 return (pidl &&
42 ((lpPData && (PT_GUID == lpPData->type || PT_SHELLEXT== lpPData->type ||
43 PT_YAGUID == lpPData->type)) || (pidl && pidl->mkid.cb == 0x00)));
44}
45
47{
48 IShellFolder *pShellFolder = NULL;
49 LPCITEMIDLIST pidlRelative = NULL;
50 STRRET str;
51 HRESULT hr;
52
53 if (pidlDirectory == NULL || szDisplayName == NULL)
54 {
55 return E_FAIL;
56 }
57
58 hr = SHBindToParent(pidlDirectory, IID_PPV_ARG(IShellFolder, &pShellFolder), &pidlRelative);
59
60 if (SUCCEEDED(hr))
61 {
62 hr = pShellFolder->GetDisplayNameOf(pidlRelative,uFlags,&str);
63 if (SUCCEEDED(hr))
64 {
65 hr = StrRetToBuf(&str,pidlDirectory,szDisplayName,cchMax);
66 }
67 pShellFolder->Release();
68 }
69 return hr;
70}
71
73 : m_pSite(NULL)
74 , m_fVisible(FALSE)
75 , m_mtxBlockNavigate(0)
76 , m_dwBandID(0)
77 , m_isEditing(FALSE)
78 , m_pidlCurrent(NULL)
79{
80}
81
83{
84 if (m_pidlCurrent)
85 {
87 }
88}
89
91{
92 // Init the treeview here
95 return;
96
97 LPITEMIDLIST pidl;
98 hr = SHGetFolderLocation(m_hWnd, CSIDL_DESKTOP, NULL, 0, &pidl);
100 return;
101
102 IImageList * piml;
105 return;
106
108
109 // Insert the root node
110 m_hRoot = InsertItem(NULL, m_pDesktop, pidl, pidl, FALSE);
111 if (!m_hRoot)
112 {
113 ERR("Failed to create root item\n");
114 return;
115 }
116
117 NodeInfo* pNodeInfo = GetNodeInfo(m_hRoot);
118
119 // Insert child nodes
120 InsertSubitems(m_hRoot, pNodeInfo);
122
123 // Navigate to current folder position
125
126#define TARGET_EVENTS ( \
127 SHCNE_DRIVEADD | SHCNE_MKDIR | SHCNE_CREATE | SHCNE_DRIVEREMOVED | SHCNE_RMDIR | \
128 SHCNE_DELETE | SHCNE_RENAMEFOLDER | SHCNE_RENAMEITEM | SHCNE_UPDATEDIR | \
129 SHCNE_UPDATEITEM | SHCNE_ASSOCCHANGED \
130)
131 // Register shell notification
132 SHChangeNotifyEntry shcne = { pidl, TRUE };
137 1, &shcne);
138 if (!m_shellRegID)
139 {
140 ERR("Something went wrong, error %08x\n", GetLastError());
141 }
142
143 // Register browser connection endpoint
144 CComPtr<IWebBrowser2> browserService;
145 hr = IUnknown_QueryService(m_pSite, SID_SWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &browserService));
147 return;
148
149 hr = AtlAdvise(browserService, dynamic_cast<IDispatch*>(this), DIID_DWebBrowserEvents, &m_adviseCookie);
151 return;
152
153 ILFree(pidl);
154}
155
157{
158 HRESULT hr;
159 CComPtr <IWebBrowser2> browserService;
160
161 TRACE("Cleaning up explorer band ...\n");
162
163 hr = IUnknown_QueryService(m_pSite, SID_SWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &browserService));
165 return;
166
167 hr = AtlUnadvise(browserService, DIID_DWebBrowserEvents, m_adviseCookie);
168 /* Remove all items of the treeview */
169 RevokeDragDrop(m_hWnd);
172 m_hRoot = NULL;
173 TRACE("Cleanup done !\n");
174}
175
177{
178 TVITEM tvItem;
179
180 tvItem.mask = TVIF_PARAM;
181 tvItem.hItem = hItem;
182
183 if (!TreeView_GetItem(m_hWnd, &tvItem))
184 return 0;
185
186 return reinterpret_cast<NodeInfo*>(tvItem.lParam);
187}
188
190{
194 if (SUCCEEDED(hr) && SUCCEEDED(hr = pfv->GetFolder(IID_PPV_ARG(IShellFolder, &psf))))
195 hr = SHELL_GetIDListFromObject(psf, &pidl);
196 return hr;
197}
198
200{
201 pidl = NULL;
203 HRESULT hr = IUnknown_QueryService(m_pSite, SID_STopLevelBrowser, IID_PPV_ARG(IShellBrowser, &psb));
205 return hr;
206
208 if (SUCCEEDED(hr = psb->QueryInterface(IID_PPV_ARG(IBrowserService, &pbs))))
209 if (SUCCEEDED(hr = pbs->GetPidl(&pidl)) && pidl)
210 return hr;
211
213 if (!FAILED_UNEXPECTEDLY(hr = psb->QueryActiveShellView(&psv)))
214 if (SUCCEEDED(hr = psv.p ? GetCurrentLocationFromView(*psv.p, pidl) : E_FAIL))
215 return hr;
216 return hr;
217}
218
220{
221 if (!pidl)
222 return E_INVALIDARG;
223 HRESULT hr = E_FAIL;
227 if (location != m_pidlCurrent)
229 return hr;
230}
231
233{
234 CComPtr<IOleWindow> pBrowserOleWnd;
235 CMINVOKECOMMANDINFO cmi;
236 HWND browserWnd;
237 HRESULT hr;
238
241 return hr;
242
243 hr = pBrowserOleWnd->GetWindow(&browserWnd);
245 return hr;
246
247 ZeroMemory(&cmi, sizeof(cmi));
248 cmi.cbSize = sizeof(cmi);
249 cmi.lpVerb = MAKEINTRESOURCEA(nCmd);
250 cmi.hwnd = browserWnd;
251 if (GetKeyState(VK_SHIFT) & 0x8000)
252 cmi.fMask |= CMIC_MASK_SHIFT_DOWN;
253 if (GetKeyState(VK_CONTROL) & 0x8000)
254 cmi.fMask |= CMIC_MASK_CONTROL_DOWN;
255
256 return menu->InvokeCommand(&cmi);
257}
258
260{
261 CComPtr<IShellBrowser> pBrowserService;
262 HRESULT hr;
263
264 hr = IUnknown_QueryService(m_pSite, SID_STopLevelBrowser, IID_PPV_ARG(IShellBrowser, &pBrowserService));
266 return hr;
267
268 hr = pBrowserService->BrowseObject(pidlGoto, SBSP_SAMEBROWSER | SBSP_ABSOLUTE);
270 return hr;
271
273 return SHILClone(pidlGoto, &m_pidlCurrent);
274}
275
276// *** notifications handling ***
278{
279 NodeInfo *pNodeInfo;
280
281 if (pnmtv->action == TVE_COLLAPSE) {
282 if (pnmtv->itemNew.hItem == m_hRoot)
283 {
284 // Prenvent root from collapsing
285 pnmtv->itemNew.mask |= TVIF_STATE;
286 pnmtv->itemNew.stateMask |= TVIS_EXPANDED;
287 pnmtv->itemNew.state &= ~TVIS_EXPANDED;
288 pnmtv->action = TVE_EXPAND;
289 return TRUE;
290 }
291 }
292 if (pnmtv->action == TVE_EXPAND) {
293 // Grab our directory PIDL
294 pNodeInfo = GetNodeInfo(pnmtv->itemNew.hItem);
295 // We have it, let's try
296 if (pNodeInfo && !pNodeInfo->expanded)
297 if (!InsertSubitems(pnmtv->itemNew.hItem, pNodeInfo)) {
298 // remove subitem "+" since we failed to add subitems
299 TV_ITEM tvItem;
300
301 tvItem.mask = TVIF_CHILDREN;
302 tvItem.hItem = pnmtv->itemNew.hItem;
303 tvItem.cChildren = 0;
304
305 TreeView_SetItem(m_hWnd, &tvItem);
306 }
307 }
308 return FALSE;
309}
310
312{
313 // Navigate to parent when deleting selected item
314 HTREEITEM hItem = pnmtv->itemOld.hItem;
315 HTREEITEM hParent = TreeView_GetParent(m_hWnd, hItem);
316 if (hParent && TreeView_GetSelection(m_hWnd) == hItem)
317 TreeView_SelectItem(m_hWnd, hParent);
318
319 /* Destroy memory associated to our node */
320 NodeInfo* pNode = GetNodeInfo(hItem);
321 if (!pNode)
322 return FALSE;
323
324 ILFree(pNode->relativePidl);
325 ILFree(pNode->absolutePidl);
326 delete pNode;
327
328 return TRUE;
329}
330
332{
333 NodeInfo* pNodeInfo = GetNodeInfo(pnmtv->itemNew.hItem);
334
335 /* Prevents navigation if selection is initiated inside the band */
337 return;
338
339 UpdateBrowser(pNodeInfo->absolutePidl);
340
341 SetFocus();
342 // Expand the node
343 //TreeView_Expand(m_hWnd, pnmtv->itemNew.hItem, TVE_EXPAND);
344}
345
347{
348 if (!pnmtv->itemNew.lParam)
349 return;
350
351 NodeInfo* pNodeInfo = GetNodeInfo(pnmtv->itemNew.hItem);
352
353 HRESULT hr;
354 CComPtr<IShellFolder> pSrcFolder;
355 LPCITEMIDLIST pLast;
356 hr = SHBindToParent(pNodeInfo->absolutePidl, IID_PPV_ARG(IShellFolder, &pSrcFolder), &pLast);
357 if (!SUCCEEDED(hr))
358 return;
359
360 SFGAOF attrs = SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_CANLINK;
361 pSrcFolder->GetAttributesOf(1, &pLast, &attrs);
362
363 DWORD dwEffect = 0;
364 if (attrs & SFGAO_CANCOPY)
365 dwEffect |= DROPEFFECT_COPY;
366 if (attrs & SFGAO_CANMOVE)
367 dwEffect |= DROPEFFECT_MOVE;
368 if (attrs & SFGAO_CANLINK)
369 dwEffect |= DROPEFFECT_LINK;
370
372 hr = pSrcFolder->GetUIObjectOf(m_hWnd, 1, &pLast, IID_IDataObject, 0, (LPVOID*)&pObj);
373 if (!SUCCEEDED(hr))
374 return;
375
376 DoDragDrop(pObj, this, dwEffect, &dwEffect);
377}
378
379// *** ATL event handlers ***
381{
383 NodeInfo *info;
384 HMENU treeMenu;
385 POINT pt;
386 CComPtr<IShellFolder> pFolder;
387 CComPtr<IContextMenu> contextMenu;
388 HRESULT hr;
389 UINT uCommand;
390 LPITEMIDLIST pidlChild;
391 UINT cmdBase = max(FCIDM_SHVIEWFIRST, 1);
392 UINT cmf = CMF_EXPLORE;
393 SFGAOF attr = SFGAO_CANRENAME;
394 BOOL startedRename = FALSE;
395
396 treeMenu = NULL;
397 item = TreeView_GetSelection(m_hWnd);
398 bHandled = TRUE;
399 if (!item)
400 {
401 goto Cleanup;
402 }
403
404 pt.x = LOWORD(lParam);
405 pt.y = HIWORD(lParam);
406 if ((UINT)lParam == (UINT)-1)
407 {
408 RECT r;
409 if (TreeView_GetItemRect(m_hWnd, item, &r, TRUE))
410 {
411 pt.x = (r.left + r.right) / 2; // Center of
412 pt.y = (r.top + r.bottom) / 2; // item rectangle
413 }
415 }
416
418 if (!info)
419 {
420 ERR("No node data, something has gone wrong !\n");
421 goto Cleanup;
422 }
423 hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pFolder),
424 (LPCITEMIDLIST*)&pidlChild);
425 if (!SUCCEEDED(hr))
426 {
427 ERR("Can't bind to folder!\n");
428 goto Cleanup;
429 }
430 hr = pFolder->GetUIObjectOf(m_hWnd, 1, (LPCITEMIDLIST*)&pidlChild, IID_IContextMenu,
431 NULL, reinterpret_cast<void**>(&contextMenu));
432 if (!SUCCEEDED(hr))
433 {
434 ERR("Can't get IContextMenu interface\n");
435 goto Cleanup;
436 }
437
438 IUnknown_SetSite(contextMenu, (IDeskBand *)this);
439
440 if (SUCCEEDED(pFolder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlChild, &attr)) && (attr & SFGAO_CANRENAME))
441 cmf |= CMF_CANRENAME;
442
443 treeMenu = CreatePopupMenu();
444 hr = contextMenu->QueryContextMenu(treeMenu, 0, cmdBase, FCIDM_SHVIEWLAST, cmf);
445 if (!SUCCEEDED(hr))
446 {
447 WARN("Can't get context menu for item\n");
448 DestroyMenu(treeMenu);
449 goto Cleanup;
450 }
451
453 pt.x, pt.y, 0, m_hWnd, NULL);
454 if (uCommand)
455 {
456 uCommand -= cmdBase;
457
458 // Do DFM_CMD_RENAME in the treeview
459 if ((cmf & CMF_CANRENAME) && SHELL_IsVerb(contextMenu, uCommand, L"rename"))
460 {
461 HTREEITEM oldSelected = m_oldSelected;
462 SetFocus();
463 startedRename = TreeView_EditLabel(m_hWnd, item) != NULL;
464 m_oldSelected = oldSelected; // Restore after TVN_BEGINLABELEDIT
465 goto Cleanup;
466 }
467
468 hr = ExecuteCommand(contextMenu, uCommand);
469 }
470
471Cleanup:
472 if (contextMenu)
473 IUnknown_SetSite(contextMenu, NULL);
474 if (treeMenu)
475 DestroyMenu(treeMenu);
476 if (startedRename)
477 {
478 // The treeview disables drawing of the edited item so we must make sure
479 // the correct item is selected (on right-click -> rename on not-current folder).
480 // TVN_ENDLABELEDIT becomes responsible for restoring the selection.
481 }
482 else
483 {
487 }
488 return TRUE;
489}
490
492{
493 bHandled = FALSE;
494 if (uMsg == WM_RBUTTONDOWN)
495 {
497 info.pt.x = LOWORD(lParam);
498 info.pt.y = HIWORD(lParam);
499 info.flags = TVHT_ONITEM;
500 info.hItem = NULL;
501
502 // Save the current location
504
505 // Move to the item selected by the treeview (don't change right pane)
506 TreeView_HitTest(m_hWnd, &info);
508 TreeView_SelectItem(m_hWnd, info.hItem);
510 }
511 return FALSE; /* let the wndproc process the message */
512}
513
514// WM_USER_SHELLEVENT
516{
517 // We use SHCNRF_NewDelivery method
518 HANDLE hChange = (HANDLE)wParam;
519 DWORD dwProcID = (DWORD)lParam;
520
521 PIDLIST_ABSOLUTE *ppidl = NULL;
522 LONG lEvent;
523 HANDLE hLock = SHChangeNotification_Lock(hChange, dwProcID, &ppidl, &lEvent);
524 if (hLock == NULL)
525 {
526 ERR("hLock == NULL\n");
527 return 0;
528 }
529
530 OnChangeNotify(ppidl[0], ppidl[1], (lEvent & ~SHCNE_INTERRUPT));
531
533 return 0;
534}
535
536BOOL
539 _In_ IEnumIDList *pEnum)
540{
541 NodeInfo* pNodeInfo = GetNodeInfo(hItem);
542 if (!pNodeInfo)
543 return FALSE;
544
545 pEnum->Reset();
546
548 while (pEnum->Next(1, &pidlTemp, NULL) == S_OK)
549 {
550 if (ILIsEqual(pidlTemp, pNodeInfo->relativePidl))
551 return TRUE;
552
553 pidlTemp.Free();
554 }
555
556 return FALSE;
557}
558
559BOOL
562 _In_ PCITEMID_CHILD pidlChild)
563{
564 for (hItem = TreeView_GetChild(m_hWnd, hItem); hItem;
566 {
567 NodeInfo* pNodeInfo = GetNodeInfo(hItem);
568 if (ILIsEqual(pNodeInfo->relativePidl, pidlChild))
569 return TRUE;
570 }
571
572 return FALSE;
573}
574
579{
580 NodeInfo* pNodeInfo = GetNodeInfo(hItem);
581
582 CComPtr<IShellFolder> psfDesktop;
583 HRESULT hr = SHGetDesktopFolder(&psfDesktop);
584 if (FAILED(hr))
585 return hr;
586
587 CComPtr<IShellFolder> pFolder;
588 hr = psfDesktop->BindToObject(pNodeInfo->absolutePidl, NULL, IID_PPV_ARG(IShellFolder, &pFolder));
589 if (FAILED(hr))
590 return hr;
591
592 return pFolder->EnumObjects(NULL, SHCONTF_FOLDERS, &pEnum);
593}
594
596{
598 HRESULT hr = GetItemEnum(pEnum, hItem);
599 if (FAILED(hr))
600 return FALSE;
601
603 hr = pEnum->Next(1, &pidlTemp, NULL);
604 return SUCCEEDED(hr);
605}
606
608{
609 NodeInfo* pNodeInfo = GetNodeInfo(hTarget);
610
612 HRESULT hrEnum = GetItemEnum(pEnum, hTarget);
613
614 // Delete zombie items
615 HTREEITEM hItem, hNextItem;
616 for (hItem = TreeView_GetChild(m_hWnd, hTarget); hItem; hItem = hNextItem)
617 {
618 hNextItem = TreeView_GetNextSibling(m_hWnd, hItem);
619
620 if (SUCCEEDED(hrEnum) && !IsTreeItemInEnum(hItem, pEnum))
621 TreeView_DeleteItem(m_hWnd, hItem);
622 }
623
624 pEnum = NULL;
625 hrEnum = GetItemEnum(pEnum, hTarget);
626
627 // Insert new items and update items
628 if (SUCCEEDED(hrEnum))
629 {
631 while (pEnum->Next(1, &pidlTemp, NULL) == S_OK)
632 {
633 if (!TreeItemHasThisChild(hTarget, pidlTemp))
634 {
635 CComHeapPtr<ITEMIDLIST> pidlAbsolute(ILCombine(pNodeInfo->absolutePidl, pidlTemp));
636 InsertItem(hTarget, pidlAbsolute, pidlTemp, TRUE);
637 }
638 pidlTemp.Free();
639 }
640 }
641
642 // Update children and recurse
643 for (hItem = TreeView_GetChild(m_hWnd, hTarget); hItem; hItem = hNextItem)
644 {
645 hNextItem = TreeView_GetNextSibling(m_hWnd, hItem);
646
648 item.hItem = hItem;
649 item.cChildren = ItemHasAnyChild(hItem);
650 TreeView_SetItem(m_hWnd, &item);
651
654 }
655}
656
658{
663}
664
665#define TIMER_ID_REFRESH 9999
666
668{
670 return 0;
671
673
674 // FIXME: Avoid full refresh and optimize for speed
675 Refresh();
676
677 return 0;
678}
679
680void
685{
686 switch (lEvent)
687 {
688 case SHCNE_DRIVEADD:
689 case SHCNE_MKDIR:
690 case SHCNE_CREATE:
692 case SHCNE_RMDIR:
693 case SHCNE_DELETE:
695 case SHCNE_RENAMEITEM:
696 case SHCNE_UPDATEDIR:
697 case SHCNE_UPDATEITEM:
699 {
702 break;
703 }
704 default:
705 {
706 TRACE("lEvent: 0x%08lX\n", lEvent);
707 break;
708 }
709 }
710}
711
713{
715 IUnknown_OnFocusChangeIS(m_pSite, reinterpret_cast<IUnknown*>(this), TRUE);
716 bHandled = FALSE;
717 return TRUE;
718}
719
721{
722 IUnknown_OnFocusChangeIS(m_pSite, reinterpret_cast<IUnknown*>(this), FALSE);
723 bHandled = FALSE;
724 return TRUE;
725}
726
727// *** Helper functions ***
730 _In_opt_ HTREEITEM hParent,
731 _Inout_ IShellFolder *psfParent,
732 _In_ LPCITEMIDLIST pElt,
733 _In_ LPCITEMIDLIST pEltRelative,
734 _In_ BOOL bSort)
735{
736 TV_INSERTSTRUCT tvInsert;
737 HTREEITEM htiCreated;
738
739 /* Get the attributes of the node */
740 SFGAOF attrs = SFGAO_STREAM | SFGAO_HASSUBFOLDER;
741 HRESULT hr = psfParent->GetAttributesOf(1, &pEltRelative, &attrs);
743 return NULL;
744
745 /* Ignore streams */
746 if (attrs & SFGAO_STREAM)
747 {
748 TRACE("Ignoring stream\n");
749 return NULL;
750 }
751
752 /* Get the name of the node */
753 WCHAR wszDisplayName[MAX_PATH];
754 STRRET strret;
755 hr = psfParent->GetDisplayNameOf(pEltRelative, SHGDN_INFOLDER, &strret);
757 return NULL;
758
759 hr = StrRetToBufW(&strret, pEltRelative, wszDisplayName, MAX_PATH);
761 return NULL;
762
763 /* Get the icon of the node */
764 INT iIcon = SHMapPIDLToSystemImageListIndex(psfParent, pEltRelative, NULL);
765
766 NodeInfo* pChildInfo = new NodeInfo;
767 if (!pChildInfo)
768 {
769 ERR("Failed to allocate NodeInfo\n");
770 return FALSE;
771 }
772
773 // Store our node info
774 pChildInfo->absolutePidl = ILClone(pElt);
775 pChildInfo->relativePidl = ILClone(pEltRelative);
776 pChildInfo->expanded = FALSE;
777
778 // Set up our treeview template
779 tvInsert.hParent = hParent;
780 tvInsert.hInsertAfter = TVI_LAST;
782 tvInsert.item.cchTextMax = MAX_PATH;
783 tvInsert.item.pszText = wszDisplayName;
784 tvInsert.item.iImage = tvInsert.item.iSelectedImage = iIcon;
785 tvInsert.item.cChildren = (attrs & SFGAO_HASSUBFOLDER) ? 1 : 0;
786 tvInsert.item.lParam = (LPARAM)pChildInfo;
787
788 htiCreated = TreeView_InsertItem(m_hWnd, &tvInsert);
789
790 if (bSort)
791 {
792 TVSORTCB sortCallback;
793 sortCallback.hParent = hParent;
794 sortCallback.lpfnCompare = CompareTreeItems;
795 sortCallback.lParam = (LPARAM)this;
796 SendMessage(TVM_SORTCHILDRENCB, 0, (LPARAM)&sortCallback);
797 }
798
799 return htiCreated;
800}
801
802/* This is the slow version of the above method */
805 _In_opt_ HTREEITEM hParent,
806 _In_ LPCITEMIDLIST pElt,
807 _In_ LPCITEMIDLIST pEltRelative,
808 _In_ BOOL bSort)
809{
810 CComPtr<IShellFolder> psfFolder;
811 HRESULT hr = SHBindToParent(pElt, IID_PPV_ARG(IShellFolder, &psfFolder), NULL);
813 return NULL;
814
815 return InsertItem(hParent, psfFolder, pElt, pEltRelative, bSort);
816}
817
819{
820 CComPtr<IEnumIDList> pEnumIDList;
821 LPITEMIDLIST pidlSub;
823 SHCONTF EnumFlags;
824 HRESULT hr;
825 ULONG fetched;
826 ULONG uItemCount;
827 CComPtr<IShellFolder> pFolder;
828 TVSORTCB sortCallback;
829
830 entry = pNodeInfo->absolutePidl;
831 fetched = 1;
832 uItemCount = 0;
833 EnumFlags = SHCONTF_FOLDERS;
834
835 hr = SHGetFolderLocation(m_hWnd, CSIDL_DESKTOP, NULL, 0, &pidlSub);
836 if (!SUCCEEDED(hr))
837 {
838 ERR("Can't get desktop PIDL !\n");
839 return FALSE;
840 }
841
842 if (!m_pDesktop->CompareIDs(NULL, pidlSub, entry))
843 {
844 // We are the desktop, so use pDesktop as pFolder
845 pFolder = m_pDesktop;
846 }
847 else
848 {
849 // Get an IShellFolder of our pidl
850 hr = m_pDesktop->BindToObject(entry, NULL, IID_PPV_ARG(IShellFolder, &pFolder));
851 if (!SUCCEEDED(hr))
852 {
853 ILFree(pidlSub);
854 ERR("Can't bind folder to desktop !\n");
855 return FALSE;
856 }
857 }
858 ILFree(pidlSub);
859
860 // TODO: handle hidden folders according to settings !
861 EnumFlags |= SHCONTF_INCLUDEHIDDEN;
862
863 // Enum through objects
864 hr = pFolder->EnumObjects(NULL,EnumFlags,&pEnumIDList);
865
866 // avoid broken IShellFolder implementations that return null pointer with success
867 if (!SUCCEEDED(hr) || !pEnumIDList)
868 {
869 ERR("Can't enum the folder !\n");
870 return FALSE;
871 }
872
873 /* Don't redraw while we add stuff into the tree */
875 while(SUCCEEDED(pEnumIDList->Next(1, &pidlSub, &fetched)) && pidlSub && fetched)
876 {
877 LPITEMIDLIST pidlSubComplete;
878 pidlSubComplete = ILCombine(entry, pidlSub);
879
880 if (InsertItem(hItem, pFolder, pidlSubComplete, pidlSub, FALSE))
881 uItemCount++;
882 ILFree(pidlSubComplete);
883 ILFree(pidlSub);
884 }
885 pNodeInfo->expanded = TRUE;
886 /* Let's do sorting */
887 sortCallback.hParent = hItem;
888 sortCallback.lpfnCompare = CompareTreeItems;
889 sortCallback.lParam = (LPARAM)this;
890 SendMessage(TVM_SORTCHILDRENCB, 0, (LPARAM)&sortCallback);
891
892 /* Now we can redraw */
894
895 return (uItemCount > 0) ? TRUE : FALSE;
896}
897
907 BOOL bSelect)
908{
910 HTREEITEM tmp;
912 NodeInfo *nodeData;
913 LPITEMIDLIST relativeChild;
914 TVITEM tvItem;
915
916 if (!item)
917 return FALSE;
918
920 parent = NULL;
921 while (TRUE)
922 {
923 nodeData = GetNodeInfo(current);
924 if (!nodeData)
925 {
926 ERR("Something has gone wrong, no data associated to node !\n");
927 *item = NULL;
928 return FALSE;
929 }
930 // If we found our node, give it back
931 if (!m_pDesktop->CompareIDs(0, nodeData->absolutePidl, dest))
932 {
933 if (bSelect)
935 *item = current;
936 return TRUE;
937 }
938
939 // Check if we are a parent of the requested item
940 relativeChild = ILFindChild(nodeData->absolutePidl, dest);
941 if (relativeChild != 0)
942 {
943 // Notify treeview we have children
944 tvItem.mask = TVIF_CHILDREN;
945 tvItem.hItem = current;
946 tvItem.cChildren = 1;
947 TreeView_SetItem(m_hWnd, &tvItem);
948
949 // If we can expand and the node isn't expanded yet, do it
950 if (bExpand)
951 {
952 if (!nodeData->expanded)
953 InsertSubitems(current, nodeData);
955 }
956
957 // Try to get a child
958 tmp = TreeView_GetChild(m_hWnd, current);
959 if (tmp)
960 {
961 // We have a child, let's continue with it
962 parent = current;
963 current = tmp;
964 continue;
965 }
966
967 if (bInsert && nodeData->expanded)
968 {
969 // Happens when we have to create a subchild inside a child
970 current = InsertItem(current, dest, relativeChild, TRUE);
971 }
972 // We end up here, without any children, so we found nothing
973 // Tell the parent node it has children
974 ZeroMemory(&tvItem, sizeof(tvItem));
975 *item = NULL;
976 return FALSE;
977 }
978
979 // Find sibling
980 tmp = TreeView_GetNextSibling(m_hWnd, current);
981 if (tmp)
982 {
983 current = tmp;
984 continue;
985 }
986 if (bInsert)
987 {
989 *item = current;
990 return TRUE;
991 }
992 *item = NULL;
993 return FALSE;
994 }
996}
997
999{
1000 LPITEMIDLIST explorerPidl;
1002 BOOL result;
1003
1004 HRESULT hr = GetCurrentLocation(explorerPidl);
1006 {
1007 ERR("Unable to get browser PIDL !\n");
1008 return FALSE;
1009 }
1011 /* find PIDL into our explorer */
1012 result = NavigateToPIDL(explorerPidl, &dummy, TRUE, FALSE, TRUE);
1014 ILFree(explorerPidl);
1015 return result;
1016}
1017
1018// *** Tree item sorting callback ***
1020{
1021 /*
1022 * We first sort drive letters (Path root), then PIDLs and then regular folder
1023 * display name.
1024 * This is not how Windows sorts item, but it gives decent results.
1025 */
1026 NodeInfo *info1;
1027 NodeInfo *info2;
1028 CExplorerBand *pThis;
1029 WCHAR wszFolder1[MAX_PATH];
1030 WCHAR wszFolder2[MAX_PATH];
1031
1032 info1 = (NodeInfo*)p1;
1033 info2 = (NodeInfo*)p2;
1034 pThis = (CExplorerBand*)p3;
1035
1036 GetDisplayName(info1->absolutePidl, wszFolder1, MAX_PATH, SHGDN_FORPARSING);
1037 GetDisplayName(info2->absolutePidl, wszFolder2, MAX_PATH, SHGDN_FORPARSING);
1038 if (PathIsRoot(wszFolder1) && PathIsRoot(wszFolder2))
1039 {
1040 return lstrcmpiW(wszFolder1,wszFolder2);
1041 }
1042 if (PathIsRoot(wszFolder1) && !PathIsRoot(wszFolder2))
1043 {
1044 return -1;
1045 }
1046 if (!PathIsRoot(wszFolder1) && PathIsRoot(wszFolder2))
1047 {
1048 return 1;
1049 }
1050 // Now, we compare non-root folders, grab display name
1051 GetDisplayName(info1->absolutePidl, wszFolder1, MAX_PATH, SHGDN_INFOLDER);
1052 GetDisplayName(info2->absolutePidl, wszFolder2, MAX_PATH, SHGDN_INFOLDER);
1053
1055 {
1056 return -1;
1057 }
1059 {
1060 return 1;
1061 }
1063 {
1064 HRESULT hr;
1065 hr = pThis->m_pDesktop->CompareIDs(0, info1->absolutePidl, info2->absolutePidl);
1066 if (!hr) return 0;
1067 return (hr > 0) ? -1 : 1;
1068 }
1069 return StrCmpLogicalW(wszFolder1, wszFolder2);
1070}
1071
1072// *** IOleWindow methods ***
1074{
1075 if (!lphwnd)
1076 return E_INVALIDARG;
1077 *lphwnd = m_hWnd;
1078 return S_OK;
1079}
1080
1082{
1084 return E_NOTIMPL;
1085}
1086
1087
1088// *** IDockingWindow methods ***
1090{
1091 // We do nothing, we don't have anything to save yet
1092 TRACE("CloseDW called\n");
1093 return S_OK;
1094}
1095
1096HRESULT STDMETHODCALLTYPE CExplorerBand::ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
1097{
1098 /* Must return E_NOTIMPL according to MSDN */
1099 return E_NOTIMPL;
1100}
1101
1103{
1104 m_fVisible = fShow;
1105 ShowWindow(fShow);
1106 return S_OK;
1107}
1108
1109
1110// *** IDeskBand methods ***
1112{
1113 if (!pdbi)
1114 {
1115 return E_INVALIDARG;
1116 }
1117 this->m_dwBandID = dwBandID;
1118
1119 if (pdbi->dwMask & DBIM_MINSIZE)
1120 {
1121 pdbi->ptMinSize.x = 200;
1122 pdbi->ptMinSize.y = 30;
1123 }
1124
1125 if (pdbi->dwMask & DBIM_MAXSIZE)
1126 {
1127 pdbi->ptMaxSize.y = -1;
1128 }
1129
1130 if (pdbi->dwMask & DBIM_INTEGRAL)
1131 {
1132 pdbi->ptIntegral.y = 1;
1133 }
1134
1135 if (pdbi->dwMask & DBIM_ACTUAL)
1136 {
1137 pdbi->ptActual.x = 200;
1138 pdbi->ptActual.y = 30;
1139 }
1140
1141 if (pdbi->dwMask & DBIM_TITLE)
1142 {
1143 if (!LoadStringW(_AtlBaseModule.GetResourceInstance(), IDS_FOLDERSLABEL, pdbi->wszTitle, _countof(pdbi->wszTitle)))
1145 }
1146
1147 if (pdbi->dwMask & DBIM_MODEFLAGS)
1148 {
1149 pdbi->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT;
1150 }
1151
1152 if (pdbi->dwMask & DBIM_BKCOLOR)
1153 {
1154 pdbi->dwMask &= ~DBIM_BKCOLOR;
1155 }
1156 return S_OK;
1157}
1158
1159
1160// *** IObjectWithSite methods ***
1162{
1163 HRESULT hr;
1164 HWND parentWnd;
1165
1166 if (pUnkSite == m_pSite)
1167 return S_OK;
1168
1169 TRACE("SetSite called \n");
1170 if (!pUnkSite)
1171 {
1173 DestroyWindow();
1174 m_hWnd = NULL;
1175 }
1176
1177 if (pUnkSite != m_pSite)
1178 {
1179 m_pSite = NULL;
1180 }
1181
1182 if(!pUnkSite)
1183 return S_OK;
1184
1185 hr = IUnknown_GetWindow(pUnkSite, &parentWnd);
1186 if (!SUCCEEDED(hr))
1187 {
1188 ERR("Could not get parent's window ! Status: %08lx\n", hr);
1189 return E_INVALIDARG;
1190 }
1191
1192 m_pSite = pUnkSite;
1193
1194 if (m_hWnd)
1195 {
1196 // Change its parent
1197 SetParent(parentWnd);
1198 }
1199 else
1200 {
1202 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
1203 0, 0, 0, 0, parentWnd, NULL, _AtlBaseModule.GetModuleInstance(), NULL);
1204
1205 // Subclass the window
1206 SubclassWindow(wnd);
1207
1208 // Initialize our treeview now
1210 RegisterDragDrop(m_hWnd, dynamic_cast<IDropTarget*>(this));
1211 }
1212 return S_OK;
1213}
1214
1216{
1217 if (!ppvSite)
1218 return E_POINTER;
1219 *ppvSite = m_pSite;
1220 return S_OK;
1221}
1222
1223
1224// *** IOleCommandTarget methods ***
1225HRESULT STDMETHODCALLTYPE CExplorerBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
1226{
1228 return E_NOTIMPL;
1229}
1230
1231HRESULT STDMETHODCALLTYPE CExplorerBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
1232{
1234 return E_NOTIMPL;
1235}
1236
1237
1238// *** IServiceProvider methods ***
1240{
1241 /* FIXME: we probably want to handle more services here */
1243}
1244
1245
1246// *** IInputObject methods ***
1248{
1249 if (fActivate)
1250 {
1251 //SetFocus();
1253 }
1254 // TODO: handle message
1255 if(lpMsg)
1256 {
1257 TranslateMessage(lpMsg);
1258 DispatchMessage(lpMsg);
1259 }
1260 return S_OK;
1261}
1262
1264{
1265 return m_bFocused ? S_OK : S_FALSE;
1266}
1267
1269{
1270 if (lpMsg->hwnd == m_hWnd ||
1271 (m_isEditing && IsChild(lpMsg->hwnd)))
1272 {
1273 TranslateMessage(lpMsg);
1274 DispatchMessage(lpMsg);
1275 return S_OK;
1276 }
1277
1278 return S_FALSE;
1279}
1280
1281// *** IPersist methods ***
1283{
1284 if (!pClassID)
1285 return E_POINTER;
1286 memcpy(pClassID, &CLSID_ExplorerBand, sizeof(CLSID));
1287 return S_OK;
1288}
1289
1290
1291// *** IPersistStream methods ***
1293{
1295 return E_NOTIMPL;
1296}
1297
1299{
1301 return E_NOTIMPL;
1302}
1303
1305{
1307 return E_NOTIMPL;
1308}
1309
1311{
1312 // TODO: calculate max size
1314 return E_NOTIMPL;
1315}
1316
1317// *** IWinEventHandler methods ***
1319{
1320 BOOL bHandled;
1322
1323 if (uMsg == WM_NOTIFY)
1324 {
1325 NMHDR *pNotifyHeader = (NMHDR*)lParam;
1326 switch (pNotifyHeader->code)
1327 {
1328 case TVN_ITEMEXPANDING:
1330 if (theResult)
1331 *theResult = result;
1332 break;
1333 case TVN_SELCHANGED:
1335 break;
1336 case TVN_DELETEITEM:
1338 break;
1339 case NM_RCLICK:
1340 OnContextMenu(WM_CONTEXTMENU, (WPARAM)m_hWnd, GetMessagePos(), bHandled);
1341 if (theResult)
1342 *theResult = 1;
1343 break;
1344 case TVN_BEGINDRAG:
1345 case TVN_BEGINRDRAG:
1347 break;
1349 {
1350 // TODO: put this in a function ? (mostly copypasta from CDefView)
1351 DWORD dwAttr = SFGAO_CANRENAME;
1354 LPCITEMIDLIST pChild;
1355 HRESULT hr;
1356
1357 if (theResult)
1358 *theResult = 1;
1359 NodeInfo *info = GetNodeInfo(dispInfo->item.hItem);
1360 if (!info)
1361 return E_FAIL;
1362 hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pParent), &pChild);
1363 if (!SUCCEEDED(hr) || !pParent.p)
1364 return E_FAIL;
1365
1366 hr = pParent->GetAttributesOf(1, &pChild, &dwAttr);
1367 if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME))
1368 {
1369 if (theResult)
1370 *theResult = 0;
1371 m_isEditing = TRUE;
1373 }
1374 return S_OK;
1375 }
1376 case TVN_ENDLABELEDITW:
1377 {
1379 NodeInfo *info = GetNodeInfo(dispInfo->item.hItem);
1380 HRESULT hr;
1381
1383 if (m_oldSelected)
1384 {
1388 }
1389
1390 if (theResult)
1391 *theResult = 0;
1392 if (dispInfo->item.pszText)
1393 {
1394 LPITEMIDLIST pidlNew;
1396 LPCITEMIDLIST pidlChild;
1397 BOOL RenamedCurrent = IsCurrentLocation(info->absolutePidl) == S_OK;
1398
1399 hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pParent), &pidlChild);
1400 if (!SUCCEEDED(hr) || !pParent.p)
1401 return E_FAIL;
1402
1403 hr = pParent->SetNameOf(m_hWnd, pidlChild, dispInfo->item.pszText, SHGDN_INFOLDER, &pidlNew);
1404 if(SUCCEEDED(hr) && pidlNew)
1405 {
1406 CComPtr<IPersistFolder2> pPersist;
1407 LPITEMIDLIST pidlParent, pidlNewAbs;
1408
1410 if(!SUCCEEDED(hr))
1411 return E_FAIL;
1412
1413 hr = pPersist->GetCurFolder(&pidlParent);
1414 if(!SUCCEEDED(hr))
1415 return E_FAIL;
1416 pidlNewAbs = ILCombine(pidlParent, pidlNew);
1417
1418 if (RenamedCurrent)
1419 {
1420 // Navigate to our new location
1421 UpdateBrowser(pidlNewAbs);
1422 }
1423 else
1424 {
1425 // Tell everyone in case SetNameOf forgot, this causes IShellView to update itself when we renamed a child
1426 SHChangeNotify(SHCNE_RENAMEFOLDER, SHCNF_IDLIST, info->absolutePidl, pidlNewAbs);
1427 }
1428
1429 ILFree(pidlParent);
1430 ILFree(pidlNewAbs);
1431 ILFree(pidlNew);
1432 if (theResult)
1433 *theResult = 1;
1434 }
1435 return S_OK;
1436 }
1437 }
1438 default:
1439 break;
1440 }
1441 }
1442 return S_OK;
1443}
1444
1446{
1447 return (hWnd == m_hWnd) ? S_OK : S_FALSE;
1448}
1449
1450// *** IBandNavigate methods ***
1452{
1454 return E_NOTIMPL;
1455}
1456
1457// *** INamespaceProxy ***
1458HRESULT STDMETHODCALLTYPE CExplorerBand::GetNavigateTarget(long paramC, long param10, long param14)
1459{
1461 return E_NOTIMPL;
1462}
1463
1465{
1467 return E_NOTIMPL;
1468}
1469
1471{
1473 return E_NOTIMPL;
1474}
1475
1476HRESULT STDMETHODCALLTYPE CExplorerBand::RefreshFlags(long paramC, long param10, long param14)
1477{
1479 return E_NOTIMPL;
1480}
1481
1483{
1485 return E_NOTIMPL;
1486}
1487
1488// *** IDispatch methods ***
1490{
1492 return E_NOTIMPL;
1493}
1494
1496{
1498 return E_NOTIMPL;
1499}
1500
1502{
1504 return E_NOTIMPL;
1505}
1506
1507HRESULT STDMETHODCALLTYPE CExplorerBand::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1508{
1509 switch (dispIdMember)
1510 {
1513 TRACE("DISPID_NAVIGATECOMPLETE2 received\n");
1515 return S_OK;
1516 }
1517 TRACE("Unknown dispid requested: %08x\n", dispIdMember);
1518 return E_INVALIDARG;
1519}
1520
1521// *** IDropTarget methods ***
1523{
1524 ERR("Entering drag\n");
1525 m_pCurObject = pObj;
1527 return DragOver(glfKeyState, pt, pdwEffect);
1528}
1529
1531{
1533 CComPtr<IShellFolder> pShellFldr;
1534 NodeInfo *nodeInfo;
1535 //LPCITEMIDLIST pChild;
1536 HRESULT hr;
1537
1538 info.pt.x = pt.x;
1539 info.pt.y = pt.y;
1540 info.flags = TVHT_ONITEM;
1541 info.hItem = NULL;
1542 ScreenToClient(&info.pt);
1543
1544 // Move to the item selected by the treeview (don't change right pane)
1545 TreeView_HitTest(m_hWnd, &info);
1546
1547 if (info.hItem)
1548 {
1550 TreeView_SelectItem(m_hWnd, info.hItem);
1552 // Delegate to shell folder
1553 if (m_pDropTarget && info.hItem != m_childTargetNode)
1554 {
1556 }
1557 if (info.hItem != m_childTargetNode)
1558 {
1559 nodeInfo = GetNodeInfo(info.hItem);
1560 if (!nodeInfo)
1561 return E_FAIL;
1562#if 0
1563 hr = SHBindToParent(nodeInfo->absolutePidl, IID_PPV_ARG(IShellFolder, &pShellFldr), &pChild);
1564 if (!SUCCEEDED(hr))
1565 return E_FAIL;
1566 hr = pShellFldr->GetUIObjectOf(m_hWnd, 1, &pChild, IID_IDropTarget, NULL, reinterpret_cast<void**>(&pDropTarget));
1567 if (!SUCCEEDED(hr))
1568 return E_FAIL;
1569#endif
1570 if(_ILIsDesktop(nodeInfo->absolutePidl))
1571 pShellFldr = m_pDesktop;
1572 else
1573 {
1574 hr = m_pDesktop->BindToObject(nodeInfo->absolutePidl, 0, IID_PPV_ARG(IShellFolder, &pShellFldr));
1575 if (!SUCCEEDED(hr))
1576 {
1577 /* Don't allow dnd since we couldn't get our folder object */
1578 ERR("Can't bind to folder object\n");
1579 *pdwEffect = DROPEFFECT_NONE;
1580 return E_FAIL;
1581 }
1582 }
1583 hr = pShellFldr->CreateViewObject(m_hWnd, IID_PPV_ARG(IDropTarget, &m_pDropTarget));
1584 if (!SUCCEEDED(hr))
1585 {
1586 /* Don't allow dnd since we couldn't get our drop target */
1587 ERR("Can't get drop target for folder object\n");
1588 *pdwEffect = DROPEFFECT_NONE;
1589 return E_FAIL;
1590 }
1591 hr = m_pDropTarget->DragEnter(m_pCurObject, glfKeyState, pt, pdwEffect);
1592 m_childTargetNode = info.hItem;
1593 }
1594 if (m_pDropTarget)
1595 {
1596 hr = m_pDropTarget->DragOver(glfKeyState, pt, pdwEffect);
1597 }
1598 }
1599 else
1600 {
1603 *pdwEffect = DROPEFFECT_NONE;
1604 }
1605 return S_OK;
1606}
1607
1609{
1614 if (m_pCurObject)
1615 {
1617 }
1618 return S_OK;
1619}
1620
1622{
1623 if (!m_pDropTarget)
1624 return E_FAIL;
1625 m_pDropTarget->Drop(pObj, glfKeyState, pt, pdwEffect);
1626 DragLeave();
1627 return S_OK;
1628}
1629
1630// *** IDropSource methods ***
1632{
1633 if (fEscapePressed)
1634 return DRAGDROP_S_CANCEL;
1635 if ((grfKeyState & MK_LBUTTON) || (grfKeyState & MK_RBUTTON))
1636 return S_OK;
1637 return DRAGDROP_S_DROP;
1638}
1639
1641{
1643}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
UINT cchMax
HWND hWnd
Definition: settings.c:17
BOOL GetDisplayName(LPCTSTR ServiceName)
Definition: name.c:12
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define UNIMPLEMENTED
Definition: debug.h:118
return
Definition: dirsup.c:529
EXTERN_C HANDLE WINAPI SHChangeNotification_Lock(HANDLE hTicket, DWORD dwOwnerPID, LPITEMIDLIST **lppidls, LPLONG lpwEventId)
EXTERN_C ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, INT fSources, LONG wEventMask, UINT uMsg, INT cItems, SHChangeNotifyEntry *lpItems)
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
EXTERN_C BOOL WINAPI SHChangeNotification_Unlock(HANDLE hLock)
LPITEMIDLIST relativePidl
Definition: explorerband.h:35
LPITEMIDLIST absolutePidl
Definition: explorerband.h:34
HTREEITEM m_hRoot
Definition: explorerband.h:50
STDMETHOD() GetSite(REFIID riid, void **ppvSite) override
BOOL OnTreeItemExpanding(LPNMTREEVIEW pnmtv)
STDMETHOD() Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
BOOL TreeItemHasThisChild(_In_ HTREEITEM hItem, _In_ PCITEMID_CHILD pidlChild)
STDMETHOD() UIActivateIO(BOOL fActivate, LPMSG lpMsg) override
HTREEITEM m_oldSelected
Definition: explorerband.h:51
STDMETHOD() ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) override
void DestroyExplorerBand()
STDMETHOD() Save(IStream *pStm, BOOL fClearDirty) override
HRESULT IsCurrentLocation(PCIDLIST_ABSOLUTE pidl)
STDMETHOD() Select(long paramC) override
void OnSelectionChanged(LPNMTREEVIEW pnmtv)
STDMETHOD() IsWindowOwner(HWND hWnd) override
void OnChangeNotify(_In_opt_ LPCITEMIDLIST pidl0, _In_opt_ LPCITEMIDLIST pidl1, _In_ LONG lEvent)
STDMETHOD() Invoke(long paramC) override
HRESULT GetItemEnum(_Out_ CComPtr< IEnumIDList > &pEnum, _In_ HTREEITEM hItem)
HRESULT ExecuteCommand(CComPtr< IContextMenu > &menu, UINT nCmd)
STDMETHOD() ShowDW(BOOL fShow) override
HTREEITEM InsertItem(_In_opt_ HTREEITEM hParent, _Inout_ IShellFolder *psfParent, _In_ LPCITEMIDLIST pElt, _In_ LPCITEMIDLIST pEltRelative, _In_ BOOL bSort)
LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
STDMETHOD() SetSite(IUnknown *pUnkSite) override
STDMETHOD() OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) override
STDMETHOD() GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) override
STDMETHOD() HasFocusIO() override
STDMETHOD() Drop(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect) override
BOOL ItemHasAnyChild(_In_ HTREEITEM hItem)
BOOL IsTreeItemInEnum(_In_ HTREEITEM hItem, _In_ IEnumIDList *pEnum)
BYTE m_mtxBlockNavigate
Definition: explorerband.h:45
void InitializeExplorerBand()
void RefreshRecurse(_In_ HTREEITEM hItem)
STDMETHOD() CloseDW(DWORD dwReserved) override
STDMETHOD() IsDirty() override
HTREEITEM m_childTargetNode
Definition: explorerband.h:60
STDMETHOD() GetWindow(HWND *lphwnd) override
DWORD m_dwBandID
Definition: explorerband.h:47
static int CALLBACK CompareTreeItems(LPARAM p1, LPARAM p2, LPARAM p3)
STDMETHOD() TranslateAcceleratorIO(LPMSG lpMsg) override
STDMETHOD() RefreshFlags(long paramC, long param10, long param14) override
STDMETHOD() Load(IStream *pStm) override
STDMETHOD() GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) override
HRESULT UpdateBrowser(LPITEMIDLIST pidlGoto)
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
BOOL NavigateToCurrentFolder()
STDMETHOD() CacheItem(long paramC) override
STDMETHOD() GetSizeMax(ULARGE_INTEGER *pcbSize) override
STDMETHOD() GetTypeInfoCount(UINT *pctinfo) override
LPITEMIDLIST m_pidlCurrent
Definition: explorerband.h:52
STDMETHOD() QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) override
BOOL NavigateToPIDL(LPCITEMIDLIST dest, HTREEITEM *item, BOOL bExpand, BOOL bInsert, BOOL bSelect)
STDMETHOD() GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi) override
STDMETHOD() QueryService(REFGUID guidService, REFIID riid, void **ppvObject) override
CComPtr< IDataObject > m_pCurObject
Definition: explorerband.h:61
void OnTreeItemDragging(LPNMTREEVIEW pnmtv, BOOL isRightClick)
CComPtr< IUnknown > m_pSite
Definition: explorerband.h:40
DWORD m_adviseCookie
Definition: explorerband.h:55
LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
NodeInfo * GetNodeInfo(HTREEITEM hItem)
STDMETHOD() QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) override
STDMETHOD() ContextSensitiveHelp(BOOL fEnterMode) override
STDMETHOD() GiveFeedback(DWORD dwEffect) override
HRESULT GetCurrentLocation(PIDLIST_ABSOLUTE &pidl)
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT ContextMenuHack(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
CComPtr< IShellFolder > m_pDesktop
Definition: explorerband.h:41
BOOL OnTreeItemDeleted(LPNMTREEVIEW pnmtv)
CComPtr< IDropTarget > m_pDropTarget
Definition: explorerband.h:59
STDMETHOD() DragOver(DWORD glfKeyState, POINTL pt, DWORD *pdwEffect) override
ULONG m_shellRegID
Definition: explorerband.h:56
STDMETHOD() DragEnter(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect) override
STDMETHOD() GetClassID(CLSID *pClassID) override
LRESULT OnShellEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
BOOL InsertSubitems(HTREEITEM hItem, NodeInfo *pNodeInfo)
virtual ~CExplorerBand()
STDMETHOD() GetNavigateTarget(long paramC, long param10, long param14) override
STDMETHOD() DragLeave() override
void Free()
Definition: atlalloc.h:153
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
Definition: fxobject.cpp:255
static BOOL bInsert
Definition: cmdinput.c:121
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw)
Definition: atl.c:45
HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
Definition: atl.c:73
UINT uFlags
Definition: api.c:59
#define IDS_FOLDERSLABEL
Definition: resource.h:128
BOOL SHELL_IsVerb(IContextMenu *pcm, UINT_PTR idCmd, LPCWSTR Verb)
Definition: utility.cpp:59
BOOL SHELL_IsEqualAbsoluteID(PCIDLIST_ABSOLUTE a, PCIDLIST_ABSOLUTE b)
Definition: utility.cpp:54
HRESULT SHELL_GetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: utility.cpp:21
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
Definition: ole2.c:557
HRESULT WINAPI DoDragDrop(IDataObject *pDataObject, IDropSource *pDropSource, DWORD dwOKEffect, DWORD *pdwEffect)
Definition: ole2.c:753
HRESULT WINAPI RevokeDragDrop(HWND hwnd)
Definition: ole2.c:639
HRESULT SHILClone(_In_opt_ LPCITEMIDLIST pidl, _Outptr_ LPITEMIDLIST *ppidl)
Definition: utils.cpp:13
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3150
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1497
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1332
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4767
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1407
INT WINAPI StrCmpLogicalW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:2304
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1530
static const WCHAR Cleanup[]
Definition: register.c:80
#define pt(x, y)
Definition: drawing.c:79
r parent
Definition: btrfs.c:3010
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
#define TIMER_ID_REFRESH
struct _PIDLDATA * LPPIDLDATA
struct _PIDLDATA PIDLDATA
#define PT_GUID
#define TARGET_EVENTS
HRESULT GetDisplayName(LPCITEMIDLIST pidlDirectory, TCHAR *szDisplayName, UINT cchMax, DWORD uFlags)
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
#define PT_YAGUID
#define PT_SHELLEXT
static HRESULT GetCurrentLocationFromView(IShellView &View, PIDLIST_ABSOLUTE &pidl)
#define WM_USER_SHELLEVENT
Definition: explorerband.h:11
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
FxObject * pParent
Definition: fxdpcapi.cpp:86
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint64EXT * result
Definition: glext.h:11304
int WINAPI SHMapPIDLToSystemImageListIndex(IShellFolder *sh, LPCITEMIDLIST pidl, int *pIndex)
Definition: iconcache.cpp:766
REFIID riid
Definition: atlbase.h:39
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
const DWORD DROPEFFECT_LINK
Definition: oleidl.idl:932
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
const DWORD DROPEFFECT_MOVE
Definition: oleidl.idl:931
HRESULT GetDisplayNameOf([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
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 memcpy(s1, s2, n)
Definition: mkisofs.h:878
struct task_struct * current
Definition: linux.c:32
static char * dest
Definition: rtl.c:135
static LPOLESTR
Definition: stg_prop.c:27
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static SHCONTF
Definition: ordinal.c:64
static VARIANTARG static DISPID
Definition: ordinal.c:52
static ATOM item
Definition: dde.c:856
#define _Inout_
Definition: ms_sal.h:378
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
unsigned int UINT
Definition: ndis.h:50
#define DWORD
Definition: nt_native.h:44
#define UNREACHABLE
#define L(x)
Definition: ntvdm.h:50
const GUID IID_IDataObject
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
long LONG
Definition: pedump.c:60
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:940
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:198
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:712
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1350
PUIDLIST_RELATIVE WINAPI ILFindChild(PIDLIST_ABSOLUTE pidl1, PCIDLIST_ABSOLUTE pidl2)
Definition: pidl.c:654
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:548
#define TVN_DELETEITEM
Definition: commctrl.h:3742
#define TVITEM
Definition: commctrl.h:3365
#define TVN_SELCHANGED
Definition: commctrl.h:3735
#define TVN_BEGINDRAG
Definition: commctrl.h:3740
#define TVI_LAST
Definition: commctrl.h:3370
#define TreeView_DeleteAllItems(hwnd)
Definition: commctrl.h:3417
#define TVM_SORTCHILDRENCB
Definition: commctrl.h:3547
#define TVIF_TEXT
Definition: commctrl.h:3266
#define TreeView_SelectItem(hwnd, hitem)
Definition: commctrl.h:3481
#define TVHT_ONITEM
Definition: commctrl.h:3527
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3420
#define TreeView_GetChild(hwnd, hitem)
Definition: commctrl.h:3466
#define TVIF_IMAGE
Definition: commctrl.h:3267
#define TVIS_EXPANDEDONCE
Definition: commctrl.h:3285
#define TVSIL_NORMAL
Definition: commctrl.h:3443
#define LPNMTREEVIEW
Definition: commctrl.h:3643
#define TreeView_GetItemState(hwndTV, hti, mask)
Definition: commctrl.h:3595
#define TreeView_GetParent(hwnd, hitem)
Definition: commctrl.h:3469
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3252
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3473
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3490
#define TVS_HASLINES
Definition: commctrl.h:3248
#define TreeView_GetItemRect(hwnd, hitem, prc, code)
Definition: commctrl.h:3429
#define TVE_EXPAND
Definition: commctrl.h:3423
#define TV_INSERTSTRUCT
Definition: commctrl.h:3377
#define TV_ITEMW
Definition: commctrl.h:3297
#define WC_TREEVIEW
Definition: commctrl.h:3245
#define TV_ITEM
Definition: commctrl.h:3300
#define TVN_BEGINRDRAG
Definition: commctrl.h:3741
#define TVIF_HANDLE
Definition: commctrl.h:3270
#define TVE_COLLAPSE
Definition: commctrl.h:3422
#define TreeView_GetNextSibling(hwnd, hitem)
Definition: commctrl.h:3467
#define TVIS_EXPANDED
Definition: commctrl.h:3284
#define NM_RCLICK
Definition: commctrl.h:133
#define TVN_ITEMEXPANDING
Definition: commctrl.h:3738
#define TVS_HASBUTTONS
Definition: commctrl.h:3247
#define TVN_BEGINLABELEDITW
Definition: commctrl.h:3710
#define TreeView_EditLabel(hwnd, hitem)
Definition: commctrl.h:3504
#define TVIF_PARAM
Definition: commctrl.h:3268
#define LPNMTVDISPINFO
Definition: commctrl.h:3676
#define TVS_EDITLABELS
Definition: commctrl.h:3250
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3447
#define TVIF_CHILDREN
Definition: commctrl.h:3272
#define TreeView_HitTest(hwnd, lpht)
Definition: commctrl.h:3513
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3412
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3271
#define TVN_ENDLABELEDITW
Definition: commctrl.h:3712
#define TreeView_SetItem(hwnd, pitem)
Definition: commctrl.h:3497
#define TVIF_STATE
Definition: commctrl.h:3269
#define TreeView_DeleteItem(hwnd, hitem)
Definition: commctrl.h:3415
#define REFIID
Definition: guiddef.h:118
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
const WCHAR * str
DWORD LCID
Definition: nls.h:13
#define SHIL_SMALL
Definition: shellapi.h:185
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
Definition: shellord.c:2668
HRESULT hr
Definition: shlfolder.c:183
#define SID_SShellBrowser
Definition: shlguid.h:128
#define SID_SWebBrowserApp
Definition: shlguid.h:111
#define SHCNE_DRIVEREMOVED
Definition: shlobj.h:1896
#define SHCNE_RMDIR
Definition: shlobj.h:1893
#define SHCNE_DELETE
Definition: shlobj.h:1891
#define SHCNE_MKDIR
Definition: shlobj.h:1892
#define SHCNE_UPDATEITEM
Definition: shlobj.h:1902
#define SHCNE_RENAMEITEM
Definition: shlobj.h:1889
#define SHCNE_UPDATEDIR
Definition: shlobj.h:1901
#define SHCNE_CREATE
Definition: shlobj.h:1890
#define SHCNE_RENAMEFOLDER
Definition: shlobj.h:1906
#define SHCNRF_NewDelivery
Definition: shlobj.h:1937
#define SHCNRF_ShellLevel
Definition: shlobj.h:1935
#define SHCNE_DRIVEADD
Definition: shlobj.h:1897
#define SHCNE_ASSOCCHANGED
Definition: shlobj.h:1910
#define CSIDL_DESKTOP
Definition: shlobj.h:2172
#define FCIDM_SHVIEWFIRST
Definition: shlobj.h:580
#define SHCNE_INTERRUPT
Definition: shlobj.h:1914
#define FCIDM_SHVIEWLAST
Definition: shlobj.h:614
#define SHCNF_IDLIST
Definition: shlobj.h:1920
#define StrRetToBuf
Definition: shlwapi.h:1769
#define PathIsRoot
Definition: shlwapi.h:955
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
Definition: scsiwmi.h:51
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
Definition: cookie.c:202
WCHAR wszTitle[256]
Definition: shobjidl.idl:2459
HWND hwnd
Definition: winuser.h:3114
UINT code
Definition: winuser.h:3159
LPARAM lParam
Definition: commctrl.h:3616
HTREEITEM hParent
Definition: commctrl.h:3614
PFNTVCOMPARE lpfnCompare
Definition: commctrl.h:3615
#define max(a, b)
Definition: svc.c:63
HANDLE lEvent
Definition: tftpd.cpp:56
HTREEITEM hItem
Definition: treelist.h:37
PVOID HANDLE
Definition: typedefs.h:73
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define DISPID_NAVIGATECOMPLETE2
Definition: webchild.h:54
#define DISPID_DOWNLOADCOMPLETE
Definition: webchild.h:39
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define S_FALSE
Definition: winerror.h:2357
#define DRAGDROP_S_USEDEFAULTCURSORS
Definition: winerror.h:2648
#define DRAGDROP_S_DROP
Definition: winerror.h:2646
#define DRAGDROP_S_CANCEL
Definition: winerror.h:2647
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define E_POINTER
Definition: winerror.h:2365
#define MK_RBUTTON
Definition: winuser.h:2368
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
DWORD WINAPI GetMessagePos(void)
Definition: message.c:1351
#define TPM_RIGHTBUTTON
Definition: winuser.h:2380
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
#define VK_CONTROL
Definition: winuser.h:2203
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CreateWindow
Definition: winuser.h:5763
#define WM_RBUTTONDOWN
Definition: winuser.h:1779
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
HWND WINAPI SetActiveWindow(_In_ HWND)
#define TPM_LEFTALIGN
Definition: winuser.h:2377
#define SendMessage
Definition: winuser.h:5852
#define TPM_LEFTBUTTON
Definition: winuser.h:2379
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MK_LBUTTON
Definition: winuser.h:2367
#define VK_SHIFT
Definition: winuser.h:2202
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define DispatchMessage
Definition: winuser.h:5774
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define TPM_RETURNCMD
Definition: winuser.h:2387
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
BOOL WINAPI DestroyWindow(_In_ HWND)
SHORT WINAPI GetKeyState(_In_ int)
#define WM_SETREDRAW
Definition: winuser.h:1616
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define IID_PPV_ARG(Itype, ppType)
char TCHAR
Definition: xmlstorage.h:189
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193