ReactOS 0.4.16-dev-732-g2d1144a
CNSCBand.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS shdocvw
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: NameSpace Control Band
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "objects.h"
9#include <shlobj.h>
10#include <commoncontrols.h>
11#include <undocshell.h>
12
13#define TIMER_ID_REFRESH 9999
14
15#include <wine/debug.h>
17
21 _In_ LPCWSTR pszLnkFile,
22 _Out_ LPWSTR pszPath)
23{
24 *pszPath = UNICODE_NULL;
25 CComPtr<IShellLink> pShellLink;
26 HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
27 IID_PPV_ARG(IShellLink, &pShellLink));
29 return hr;
30
31 CComPtr<IPersistFile> pPersistFile;
32 hr = pShellLink->QueryInterface(IID_PPV_ARG(IPersistFile, &pPersistFile));
34 return hr;
35
36 hr = pPersistFile->Load(pszLnkFile, STGM_READ);
38 return hr;
39
41 hr = pShellLink->GetPath(pszPath, MAX_PATH, &find, 0);
43 return hr;
44
45 return S_OK;
46}
47
50 _In_ LPCWSTR pszLnkFileName,
51 _In_ PCIDLIST_ABSOLUTE pidlTarget,
52 _In_opt_ LPCWSTR pszDescription)
53{
54 HRESULT hr;
55
56 CComPtr<IShellLink> psl;
57 hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
58 IID_PPV_ARG(IShellLink, &psl));
60 return hr;
61
62 psl->SetIDList(pidlTarget);
63
64 if (pszDescription)
65 psl->SetDescription(pszDescription);
66
67 CComPtr<IPersistFile> ppf;
70 return hr;
71
72 return ppf->Save(pszLnkFileName, TRUE);
73}
74
75CNSCBand::CNSCBand()
76{
78
81}
82
83CNSCBand::~CNSCBand()
84{
85 if (m_hToolbarImageList)
86 {
87 ImageList_Destroy(m_hToolbarImageList);
88 m_hToolbarImageList = NULL;
89 }
91}
92
93VOID CNSCBand::OnFinalMessage(HWND)
94{
95 // The message loop is finished, now we can safely destruct!
96 // HACKFIX: Who did this AddRef? Commenting out Release...
97 //static_cast<IDeskBand *>(this)->Release();
98}
99
100// *** helper methods ***
101
102CNSCBand::CItemData* CNSCBand::GetItemData(_In_ HTREEITEM hItem)
103{
104 if (hItem == TVI_ROOT)
105 return NULL;
106
107 TVITEMW tvItem = { TVIF_PARAM, hItem };
108 if (!TreeView_GetItem(m_hwndTreeView, &tvItem))
109 return NULL;
110
111 return reinterpret_cast<CItemData*>(tvItem.lParam);
112}
113
114static HRESULT
116{
117 CComPtr<IFolderView> pfv;
118 CComPtr<IShellFolder> psf;
120 if (SUCCEEDED(hr) && SUCCEEDED(hr = pfv->GetFolder(IID_PPV_ARG(IShellFolder, &psf))))
121 hr = SHELL_GetIDListFromObject(psf, ppidl);
122 return hr;
123}
124
125HRESULT CNSCBand::_GetCurrentLocation(_Out_ PIDLIST_ABSOLUTE *ppidl)
126{
127 *ppidl = NULL;
128 CComPtr<IShellBrowser> psb;
129 HRESULT hr = IUnknown_QueryService(m_pSite, SID_STopLevelBrowser, IID_PPV_ARG(IShellBrowser, &psb));
131 return hr;
132
133 CComPtr<IBrowserService> pbs;
135 if (SUCCEEDED(hr = pbs->GetPidl(ppidl)) && *ppidl)
136 return hr;
137
138 CComPtr<IShellView> psv;
139 if (!FAILED_UNEXPECTEDLY(hr = psb->QueryActiveShellView(&psv)))
140 if (SUCCEEDED(hr = psv.p ? SHDOCVW_GetCurrentLocationFromView(*psv.p, ppidl) : E_FAIL))
141 return hr;
142 return hr;
143}
144
145HRESULT CNSCBand::_IsCurrentLocation(_In_ PCIDLIST_ABSOLUTE pidl)
146{
147 if (!pidl)
148 return E_INVALIDARG;
149 HRESULT hr = E_FAIL;
151 hr = _GetCurrentLocation(&location);
152 if (SUCCEEDED(hr))
155 return hr;
156}
157
158HRESULT CNSCBand::_ExecuteCommand(_In_ CComPtr<IContextMenu>& menu, _In_ UINT nCmd)
159{
160 CComPtr<IOleWindow> pBrowserOleWnd;
162 IID_PPV_ARG(IOleWindow, &pBrowserOleWnd));
164 return hr;
165
166 HWND browserWnd;
167 hr = pBrowserOleWnd->GetWindow(&browserWnd);
169 return hr;
170
171 CMINVOKECOMMANDINFO cmi = { sizeof(cmi) };
172 cmi.lpVerb = MAKEINTRESOURCEA(nCmd);
173 cmi.hwnd = browserWnd;
174 cmi.nShow = SW_SHOW;
175 if (::GetKeyState(VK_SHIFT) < 0)
176 cmi.fMask |= CMIC_MASK_SHIFT_DOWN;
177 if (::GetKeyState(VK_CONTROL) < 0)
178 cmi.fMask |= CMIC_MASK_CONTROL_DOWN;
179
180 return menu->InvokeCommand(&cmi);
181}
182
183void CNSCBand::_RegisterChangeNotify()
184{
185#define TARGET_EVENTS ( \
186 SHCNE_DRIVEADD | SHCNE_MKDIR | SHCNE_CREATE | SHCNE_DRIVEREMOVED | SHCNE_RMDIR | \
187 SHCNE_DELETE | SHCNE_RENAMEFOLDER | SHCNE_RENAMEITEM | SHCNE_UPDATEDIR | \
188 SHCNE_UPDATEITEM | SHCNE_ASSOCCHANGED \
189)
190 // Register shell notification
191 SHChangeNotifyEntry shcne = { m_pidlRoot, TRUE };
192 m_shellRegID = SHChangeNotifyRegister(m_hWnd,
196 1, &shcne);
197 if (!m_shellRegID)
198 {
199 ERR("Something went wrong, error %08x\n", GetLastError());
200 }
201}
202
203void CNSCBand::_UnregisterChangeNotify()
204{
205 SHChangeNotifyDeregister(m_shellRegID);
206 m_shellRegID = 0;
207}
208
209void CNSCBand::_DestroyTreeView()
210{
211 TRACE("Cleaning up treeview...\n");
212 /* Remove all items of the treeview */
213 ::RevokeDragDrop(m_hwndTreeView);
214 TreeView_DeleteAllItems(m_hwndTreeView);
215 m_hwndTreeView.DestroyWindow();
216 m_pDesktop = NULL;
217 m_hRoot = NULL;
218 TRACE("Cleanup ok\n");
219}
220
221void CNSCBand::_DestroyToolbar()
222{
223 m_hwndToolbar.DestroyWindow();
224}
225
226HRESULT CNSCBand::_CreateTreeView(HWND hwndParent)
227{
228 RefreshFlags(&m_dwTVStyle, &m_dwTVExStyle, &m_dwEnumFlags);
229 HWND hwndTV = ::CreateWindowExW(m_dwTVExStyle, WC_TREEVIEWW, NULL, m_dwTVStyle, 0, 0, 0, 0,
231 ATLASSERT(hwndTV);
232 if (!hwndTV)
233 return E_FAIL;
234
235 m_hwndTreeView.Attach(hwndTV);
236 ::RegisterDragDrop(m_hwndTreeView, dynamic_cast<IDropTarget*>(this));
237
238 // Init the treeview here
239 HRESULT hr = SHGetDesktopFolder(&m_pDesktop);
241 return hr;
242
243 m_pidlRoot.Free();
244 hr = SHGetFolderLocation(m_hWnd, _GetRootCsidl(), NULL, 0, &m_pidlRoot);
246 return hr;
247
248 // Create image list and set
249 IImageList *piml;
252 return hr;
253
254 TreeView_SetImageList(m_hwndTreeView, (HIMAGELIST)piml, TVSIL_NORMAL);
255 return S_OK;
256}
257
258BOOL
259CNSCBand::_IsTreeItemInEnum(
261 _In_ IEnumIDList *pEnum)
262{
263 CItemData* pItemData = GetItemData(hItem);
264 if (!pItemData)
265 return FALSE;
266
267 pEnum->Reset();
268
269 CComHeapPtr<ITEMIDLIST_RELATIVE> pidlTemp;
270 while (pEnum->Next(1, &pidlTemp, NULL) == S_OK)
271 {
272 if (ILIsEqual(pidlTemp, pItemData->relativePidl))
273 return TRUE;
274
275 pidlTemp.Free();
276 }
277
278 return FALSE;
279}
280
281BOOL
282CNSCBand::_TreeItemHasThisChild(
284 _In_ PCITEMID_CHILD pidlChild)
285{
286 for (hItem = TreeView_GetChild(m_hwndTreeView, hItem); hItem;
287 hItem = TreeView_GetNextSibling(m_hwndTreeView, hItem))
288 {
289 CItemData* pItemData = GetItemData(hItem);
290 if (ILIsEqual(pItemData->relativePidl, pidlChild))
291 return TRUE;
292 }
293
294 return FALSE;
295}
296
298CNSCBand::_GetItemEnum(
299 _Out_ CComPtr<IEnumIDList>& pEnum,
301 _Out_opt_ IShellFolder **ppFolder)
302{
303 CComPtr<IShellFolder> psfDesktop;
304 HRESULT hr = SHGetDesktopFolder(&psfDesktop);
306 return hr;
307
308 CComPtr<IShellFolder> pFolder;
309 if (!ppFolder)
310 ppFolder = &pFolder;
311
312 if (hItem == m_hRoot && hItem)
313 {
314 *ppFolder = psfDesktop;
315 (*ppFolder)->AddRef();
316 }
317 else
318 {
319 CItemData* pItemData = GetItemData(hItem);
320 if (!pItemData && hItem == TVI_ROOT && !_WantsRootItem())
321 hr = psfDesktop->BindToObject(m_pidlRoot, NULL, IID_PPV_ARG(IShellFolder, ppFolder));
322 else
323 hr = psfDesktop->BindToObject(pItemData->absolutePidl, NULL, IID_PPV_ARG(IShellFolder, ppFolder));
325 return hr;
326 }
327
328 return (*ppFolder)->EnumObjects(NULL, _GetEnumFlags(), &pEnum);
329}
330
331BOOL CNSCBand::_ItemHasAnyChild(_In_ HTREEITEM hItem)
332{
333 CComPtr<IEnumIDList> pEnum;
334 HRESULT hr = _GetItemEnum(pEnum, hItem);
335 if (FAILED(hr))
336 return FALSE;
337
338 CComHeapPtr<ITEMIDLIST_RELATIVE> pidlTemp;
339 hr = pEnum->Next(1, &pidlTemp, NULL);
340 return SUCCEEDED(hr);
341}
342
343void CNSCBand::_RefreshRecurse(_In_ HTREEITEM hTarget)
344{
345 CComPtr<IEnumIDList> pEnum;
346 HRESULT hrEnum = _GetItemEnum(pEnum, hTarget);
347
348 // Delete zombie items
349 HTREEITEM hItem, hNextItem;
350 for (hItem = TreeView_GetChild(m_hwndTreeView, hTarget); hItem; hItem = hNextItem)
351 {
352 hNextItem = TreeView_GetNextSibling(m_hwndTreeView, hItem);
353
354 if (SUCCEEDED(hrEnum) && !_IsTreeItemInEnum(hItem, pEnum))
355 TreeView_DeleteItem(m_hwndTreeView, hItem);
356 }
357
358 pEnum = NULL;
359 hrEnum = _GetItemEnum(pEnum, hTarget);
360
361 CItemData* pItemData = ((hTarget == TVI_ROOT) ? NULL : GetItemData(hTarget));
362
363 // Insert new items and update items
364 if (SUCCEEDED(hrEnum))
365 {
366 CComHeapPtr<ITEMIDLIST_RELATIVE> pidlTemp;
367 while (pEnum->Next(1, &pidlTemp, NULL) == S_OK)
368 {
369 if (!_TreeItemHasThisChild(hTarget, pidlTemp))
370 {
371 if (pItemData)
372 {
373 CComHeapPtr<ITEMIDLIST> pidlAbsolute(ILCombine(pItemData->absolutePidl, pidlTemp));
374 _InsertItem(hTarget, pidlAbsolute, pidlTemp, TRUE);
375 }
376 else
377 {
378 CComHeapPtr<ITEMIDLIST> pidlAbsolute(ILCombine(m_pidlRoot, pidlTemp));
379 _InsertItem(hTarget, pidlAbsolute, pidlTemp, TRUE);
380 }
381 }
382 pidlTemp.Free();
383 }
384 }
385
386 // Update children and recurse
387 for (hItem = TreeView_GetChild(m_hwndTreeView, hTarget); hItem; hItem = hNextItem)
388 {
389 hNextItem = TreeView_GetNextSibling(m_hwndTreeView, hItem);
390
392 item.hItem = hItem;
393 item.cChildren = _ItemHasAnyChild(hItem);
394 TreeView_SetItem(m_hwndTreeView, &item);
395
397 _RefreshRecurse(hItem);
398 }
399}
400
401void CNSCBand::_Refresh()
402{
403 m_hwndTreeView.SendMessage(WM_SETREDRAW, FALSE, 0);
404 _RefreshRecurse(_WantsRootItem() ? m_hRoot : TVI_ROOT);
405 m_hwndTreeView.SendMessage(WM_SETREDRAW, TRUE, 0);
406}
407
408LRESULT CNSCBand::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
409{
411
413 _Refresh();
414
415 return 0;
416}
417
418void
419CNSCBand::OnChangeNotify(
423{
424 switch (lEvent)
425 {
426 case SHCNE_DRIVEADD:
427 case SHCNE_MKDIR:
428 case SHCNE_CREATE:
430 case SHCNE_RMDIR:
431 case SHCNE_DELETE:
433 case SHCNE_RENAMEITEM:
434 case SHCNE_UPDATEDIR:
435 case SHCNE_UPDATEITEM:
437 {
440 break;
441 }
442 default:
443 {
444 TRACE("lEvent: 0x%08lX\n", lEvent);
445 break;
446 }
447 }
448}
449
451CNSCBand::_InsertItem(
452 _In_opt_ HTREEITEM hParent,
453 _Inout_ IShellFolder *psfParent,
454 _In_ LPCITEMIDLIST pElt,
455 _In_ LPCITEMIDLIST pEltRelative,
456 _In_ BOOL bSort)
457{
458 /* Get the attributes of the node */
459 SFGAOF attrs = SFGAO_STREAM | SFGAO_HASSUBFOLDER;
460 HRESULT hr = psfParent->GetAttributesOf(1, &pEltRelative, &attrs);
462 return NULL;
463
464 /* Get the name of the node */
465 WCHAR wszDisplayName[MAX_PATH];
466 STRRET strret;
467 hr = psfParent->GetDisplayNameOf(pEltRelative, SHGDN_INFOLDER, &strret);
469 return NULL;
470
471 hr = StrRetToBufW(&strret, pEltRelative, wszDisplayName, MAX_PATH);
473 return NULL;
474
475 /* Get the icon of the node */
476 INT iIcon = SHMapPIDLToSystemImageListIndex(psfParent, pEltRelative, NULL);
477
478 CItemData* pChildInfo = new CItemData;
479 if (!pChildInfo)
480 {
481 ERR("Failed to allocate CItemData\n");
482 return NULL;
483 }
484 pChildInfo->absolutePidl.Attach(ILClone(pElt));
485 pChildInfo->relativePidl.Attach(ILClone(pEltRelative));
486
487 // Set up our treeview template
488 TV_INSERTSTRUCT tvInsert = { hParent, TVI_LAST };
490 tvInsert.item.cchTextMax = MAX_PATH;
491 tvInsert.item.pszText = wszDisplayName;
492 tvInsert.item.iImage = tvInsert.item.iSelectedImage = iIcon;
493 tvInsert.item.lParam = (LPARAM)pChildInfo;
494
495 if (!(attrs & SFGAO_STREAM) && (attrs & SFGAO_HASSUBFOLDER))
496 tvInsert.item.cChildren = 1;
497
498 HTREEITEM htiCreated = TreeView_InsertItem(m_hwndTreeView, &tvInsert);
499
500 if (bSort)
501 _SortItems(hParent);
502
503 return htiCreated;
504}
505
506/* This is the slow version of the above method */
508CNSCBand::_InsertItem(
509 _In_opt_ HTREEITEM hParent,
510 _In_ LPCITEMIDLIST pElt,
511 _In_ LPCITEMIDLIST pEltRelative,
512 _In_ BOOL bSort)
513{
514 CComPtr<IShellFolder> psfFolder;
515 HRESULT hr = SHBindToParent(pElt, IID_PPV_ARG(IShellFolder, &psfFolder), NULL);
517 return NULL;
518
519 return _InsertItem(hParent, psfFolder, pElt, pEltRelative, bSort);
520}
521
522BOOL CNSCBand::_InsertSubitems(HTREEITEM hItem, LPCITEMIDLIST entry)
523{
524 ULONG fetched = 1, uItemCount = 0;
525
526 CComPtr<IEnumIDList> pEnum;
527 CComPtr<IShellFolder> pFolder;
528 HRESULT hr = _GetItemEnum(pEnum, hItem, &pFolder);
530 return FALSE;
531
532 /* Don't redraw while we add stuff into the tree */
533 m_hwndTreeView.SendMessage(WM_SETREDRAW, FALSE, 0);
534
535 LPITEMIDLIST pidlSub;
536 while (SUCCEEDED(pEnum->Next(1, &pidlSub, &fetched)) && pidlSub && fetched)
537 {
538 LPITEMIDLIST pidlSubComplete;
539 pidlSubComplete = ILCombine(entry, pidlSub);
540
541 if (_InsertItem(hItem, pFolder, pidlSubComplete, pidlSub, FALSE))
542 ++uItemCount;
543
544 ILFree(pidlSubComplete);
545 ILFree(pidlSub);
546 }
547
548 /* Let's do sorting */
549 _SortItems(hItem);
550
551 /* Now we can redraw */
552 m_hwndTreeView.SendMessage(WM_SETREDRAW, TRUE, 0);
553
554 return (uItemCount > 0);
555}
556
557// *** message handlers ***
558
559LRESULT CNSCBand::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
560{
561 if (FAILED_UNEXPECTEDLY(_CreateToolbar(m_hWnd)))
562 return -1;
563 if (FAILED_UNEXPECTEDLY(_CreateTreeView(m_hWnd)))
564 return -1;
565 return 0;
566}
567
568LRESULT CNSCBand::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
569{
570 _DestroyTreeView();
571 _DestroyToolbar();
572 _UnregisterChangeNotify();
573 return 0;
574}
575
576LRESULT CNSCBand::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
577{
578 if (!m_hwndTreeView)
579 return 0;
580
581 RECT rc;
582 GetClientRect(&rc);
583 LONG cx = rc.right, cy = rc.bottom;
584
585 RECT rcTB;
586 LONG cyTB = 0;
587 if (m_hwndToolbar)
588 {
589 m_hwndToolbar.SendMessage(TB_AUTOSIZE, 0, 0);
590 m_hwndToolbar.GetWindowRect(&rcTB);
591 cyTB = rcTB.bottom - rcTB.top;
592 }
593
594 m_hwndTreeView.MoveWindow(0, cyTB, cx, cy - cyTB);
595 return 0;
596}
597
598LRESULT CNSCBand::OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
599{
600 m_bFocused = TRUE;
601 IUnknown_OnFocusChangeIS(m_pSite, reinterpret_cast<IUnknown*>(this), TRUE);
602 bHandled = FALSE;
603 return 0;
604}
605
606LRESULT CNSCBand::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
607{
608 IUnknown_OnFocusChangeIS(m_pSite, reinterpret_cast<IUnknown*>(this), FALSE);
609 m_bFocused = FALSE;
610 return 0;
611}
612
613HRESULT CNSCBand::_AddFavorite()
614{
615 CComHeapPtr<ITEMIDLIST> pidlCurrent;
616 _GetCurrentLocation(&pidlCurrent);
617
618 WCHAR szCurDir[MAX_PATH];
619 if (!ILGetDisplayName(pidlCurrent, szCurDir))
620 {
621 FIXME("\n");
622 return E_FAIL;
623 }
624
625 WCHAR szPath[MAX_PATH], szSuffix[32];
628
629 const INT ich = lstrlenW(szPath);
630 for (INT iTry = 2; iTry <= 9999; ++iTry)
631 {
632 PathAddExtensionW(szPath, L".lnk");
634 break;
635 szPath[ich] = UNICODE_NULL;
636 wsprintfW(szSuffix, L" (%d)", iTry);
637 lstrcatW(szPath, szSuffix);
638 }
639
640 TRACE("%S, %S\n", szCurDir, szPath);
641
642 return SHDOCVW_CreateShortcut(szPath, pidlCurrent, NULL);
643}
644
645LRESULT CNSCBand::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
646{
647 switch (LOWORD(wParam))
648 {
649 case ID_ADD:
650 {
651 _AddFavorite();
652 break;
653 }
654 case ID_ORGANIZE:
655 {
656 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_INVOKEIDLIST };
657 sei.hwnd = m_hWnd;
658 sei.nShow = SW_SHOWNORMAL;
659 sei.lpIDList = m_pidlRoot;
660 ::ShellExecuteExW(&sei);
661 break;
662 }
663 }
664 return 0;
665}
666
667BOOL CNSCBand::OnTreeItemExpanding(_In_ LPNMTREEVIEW pnmtv)
668{
669 CItemData *pItemData;
670
671 if (pnmtv->action == TVE_COLLAPSE)
672 {
673 if (pnmtv->itemNew.hItem == m_hRoot)
674 {
675 // Prenvent root from collapsing
676 pnmtv->itemNew.mask |= TVIF_STATE;
677 pnmtv->itemNew.stateMask |= TVIS_EXPANDED;
678 pnmtv->itemNew.state &= ~TVIS_EXPANDED;
679 pnmtv->action = TVE_EXPAND;
680 return TRUE;
681 }
682 }
683
684 if (pnmtv->action == TVE_EXPAND)
685 {
686 // Grab our directory PIDL
687 pItemData = GetItemData(pnmtv->itemNew.hItem);
688 // We have it, let's try
689 if (pItemData && !pItemData->expanded)
690 {
691 if (_InsertSubitems(pnmtv->itemNew.hItem, pItemData->absolutePidl))
692 {
693 pItemData->expanded = TRUE;
694 }
695 else
696 {
697 // remove subitem "+" since we failed to add subitems
698 TVITEMW tvItem = { TVIF_CHILDREN, pnmtv->itemNew.hItem };
699 tvItem.cChildren = 0;
700 TreeView_SetItem(m_hwndTreeView, &tvItem);
701 }
702 }
703 }
704 return FALSE;
705}
706
707BOOL CNSCBand::OnTreeItemDeleted(_In_ LPNMTREEVIEW pnmtv)
708{
709 // Navigate to parent when deleting selected item
710 HTREEITEM hItem = pnmtv->itemOld.hItem;
711 HTREEITEM hParent = TreeView_GetParent(m_hwndTreeView, hItem);
712 if (hParent && TreeView_GetSelection(m_hwndTreeView) == hItem)
713 TreeView_SelectItem(m_hwndTreeView, hParent);
714
715 /* Destroy memory associated to our node */
716 CItemData* pItemData = GetItemData(hItem);
717 if (!pItemData)
718 return FALSE;
719
720 delete pItemData;
721
722 return TRUE;
723}
724
725void CNSCBand::_OnSelectionChanged(_In_ LPNMTREEVIEW pnmtv)
726{
727 HTREEITEM hItem = pnmtv->itemNew.hItem;
728 if (!hItem)
729 return;
730 CItemData* pItemData = GetItemData(hItem);
731 if (pItemData)
732 OnSelectionChanged(pItemData->absolutePidl);
733}
734
735void CNSCBand::OnTreeItemDragging(_In_ LPNMTREEVIEW pnmtv, _In_ BOOL isRightClick)
736{
737 CItemData* pItemData = GetItemData(pnmtv->itemNew.hItem);
738 if (!pItemData)
739 return;
740
741 HRESULT hr;
742 CComPtr<IShellFolder> pSrcFolder;
743 LPCITEMIDLIST pLast;
744 hr = SHBindToParent(pItemData->absolutePidl, IID_PPV_ARG(IShellFolder, &pSrcFolder), &pLast);
746 return;
747
748 SFGAOF attrs = SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_CANLINK;
749 pSrcFolder->GetAttributesOf(1, &pLast, &attrs);
750
751 DWORD dwEffect = 0;
752 if (attrs & SFGAO_CANCOPY)
753 dwEffect |= DROPEFFECT_COPY;
754 if (attrs & SFGAO_CANMOVE)
755 dwEffect |= DROPEFFECT_MOVE;
756 if (attrs & SFGAO_CANLINK)
757 dwEffect |= DROPEFFECT_LINK;
758
759 CComPtr<IDataObject> pObj;
760 hr = pSrcFolder->GetUIObjectOf(m_hWnd, 1, &pLast, IID_IDataObject, 0, (LPVOID*)&pObj);
762 return;
763
764 DoDragDrop(pObj, this, dwEffect, &dwEffect);
765}
766
767LRESULT CNSCBand::OnBeginLabelEdit(_In_ LPNMTVDISPINFO dispInfo)
768{
769 // TODO: put this in a function ? (mostly copypasta from CDefView)
770 DWORD dwAttr = SFGAO_CANRENAME;
771 CComPtr<IShellFolder> pParent;
772 LPCITEMIDLIST pChild;
773 HRESULT hr;
774
775 CItemData *info = GetItemData(dispInfo->item.hItem);
776 if (!info)
777 return FALSE;
778
779 hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pParent), &pChild);
781 return FALSE;
782
783 hr = pParent->GetAttributesOf(1, &pChild, &dwAttr);
784 if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME))
785 {
786 m_isEditing = TRUE;
787 m_oldSelected = NULL;
788 return FALSE;
789 }
790
791 return TRUE;
792}
793
794HRESULT CNSCBand::_UpdateBrowser(LPCITEMIDLIST pidlGoto)
795{
796 CComPtr<IShellBrowser> pBrowserService;
797 HRESULT hr = IUnknown_QueryService(m_pSite, SID_STopLevelBrowser,
798 IID_PPV_ARG(IShellBrowser, &pBrowserService));
800 return hr;
801
802 hr = pBrowserService->BrowseObject(pidlGoto, SBSP_SAMEBROWSER | SBSP_ABSOLUTE);
804 return hr;
805
806 return S_OK;
807}
808
809LRESULT CNSCBand::OnEndLabelEdit(_In_ LPNMTVDISPINFO dispInfo)
810{
811 CItemData *info = GetItemData(dispInfo->item.hItem);
812 HRESULT hr;
813
814 m_isEditing = FALSE;
815 if (m_oldSelected)
816 {
817 ++m_mtxBlockNavigate;
818 TreeView_SelectItem(m_hwndTreeView, m_oldSelected);
819 --m_mtxBlockNavigate;
820 }
821
822 if (!dispInfo->item.pszText)
823 return FALSE;
824
825 CComPtr<IShellFolder> pParent;
826 LPCITEMIDLIST pidlChild;
827 BOOL RenamedCurrent = _IsCurrentLocation(info->absolutePidl) == S_OK;
828
829 hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pParent), &pidlChild);
831 return FALSE;
832
833 CComHeapPtr<ITEMIDLIST> pidlNew;
834 hr = pParent->SetNameOf(m_hWnd, pidlChild, dispInfo->item.pszText, SHGDN_INFOLDER, &pidlNew);
835 if (SUCCEEDED(hr) && pidlNew)
836 {
837 CComPtr<IPersistFolder2> pPersist;
840 return FALSE;
841
842 CComHeapPtr<ITEMIDLIST> pidlParent;
843 hr = pPersist->GetCurFolder(&pidlParent);
845 return FALSE;
846
847 CComHeapPtr<ITEMIDLIST> pidlNewAbs(ILCombine(pidlParent, pidlNew));
848 if (RenamedCurrent)
849 {
850 _UpdateBrowser(pidlNewAbs);
851 }
852 else
853 {
854 // Tell everyone if SetNameOf forgot, this causes IShellView to update itself when we rename a child
855 SHChangeNotify(SHCNE_RENAMEFOLDER, SHCNF_IDLIST, info->absolutePidl, pidlNewAbs);
856 }
857
858 return TRUE;
859 }
860
861 return FALSE;
862}
863
864LRESULT CNSCBand::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
865{
866 NMHDR *pnmhdr = (NMHDR*)lParam;
867 switch (pnmhdr->code)
868 {
870 return OnTreeItemExpanding((LPNMTREEVIEW)lParam);
871 //case TVN_SINGLEEXPAND:
872 case TVN_SELCHANGED:
873 if (pnmhdr->hwndFrom == m_hwndTreeView)
874 _OnSelectionChanged((LPNMTREEVIEW)lParam);
875 break;
876 case TVN_DELETEITEM:
877 OnTreeItemDeleted((LPNMTREEVIEW)lParam);
878 break;
879 case NM_CLICK:
880 case NM_RCLICK:
881 if (pnmhdr->hwndFrom == m_hwndTreeView)
882 {
883 TVHITTESTINFO HitTest;
884 ::GetCursorPos(&HitTest.pt);
885 ::ScreenToClient(m_hwndTreeView, &HitTest.pt);
886 TreeView_HitTest(m_hwndTreeView, &HitTest);
887
888 if (HitTest.flags & (TVHT_ABOVE | TVHT_BELOW | TVHT_NOWHERE))
889 return TRUE; // Prevents click processing
890
891 if (HitTest.flags & TVHT_ONITEMBUTTON) // [+] / [-]
892 break; // Do default processing
893
894 // Generate selection notification even if same item
895 m_hwndTreeView.SendMessage(WM_SETREDRAW, FALSE, 0);
896 TreeView_SelectItem(m_hwndTreeView, NULL);
897 TreeView_SelectItem(m_hwndTreeView, HitTest.hItem);
898 m_hwndTreeView.SendMessage(WM_SETREDRAW, TRUE, 0);
899
900 if (pnmhdr->code == NM_CLICK)
901 return TRUE; // Prevents click processing
902 }
903 break;
904 case TVN_BEGINDRAG:
905 case TVN_BEGINRDRAG:
906 OnTreeItemDragging((LPNMTREEVIEW)lParam, pnmhdr->code == TVN_BEGINRDRAG);
907 break;
912 default:
913 break;
914 }
915
916 return 0;
917}
918
919// Temporary menu
921{
923 CMenuTemp(HMENU hMenu) : m_hMenu(hMenu)
924 {
925 }
927 {
928 if (m_hMenu)
930 }
931 operator HMENU() const
932 {
933 return m_hMenu;
934 }
935};
936
937// *** ATL event handlers ***
938LRESULT CNSCBand::OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
939{
940 HWND hwndTarget = reinterpret_cast<HWND>(wParam);
941 if (hwndTarget && (hwndTarget == m_hwndToolbar || hwndTarget == m_hWnd))
942 {
943 FIXME("Show 'Close Toolbar' menu\n");
944 return 0;
945 }
946
947 HTREEITEM hItem = TreeView_GetSelection(m_hwndTreeView);
948 if (!hItem)
949 return 0;
950
952 if ((UINT)lParam == (UINT)-1)
953 {
954 RECT rc;
955 if (TreeView_GetItemRect(m_hwndTreeView, hItem, &rc, TRUE))
956 {
957 // Center of item rectangle
958 pt.x = (rc.left + rc.right) / 2;
959 pt.y = (rc.top + rc.bottom) / 2;
960 }
962 }
963
964 CItemData *info = GetItemData(hItem);
965 if (!info)
966 {
967 ERR("No node data, something has gone wrong\n");
968 return 0;
969 }
970
971 CComPtr<IShellFolder> pFolder;
972 LPCITEMIDLIST pidlChild;
973 HRESULT hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pFolder), &pidlChild);
975 return 0;
976
977 CComPtr<IContextMenu> contextMenu;
978 hr = pFolder->GetUIObjectOf(m_hWnd, 1, &pidlChild, IID_NULL_PPV_ARG(IContextMenu, &contextMenu));
980 return 0;
981
982 IUnknown_SetSite(contextMenu, (IDeskBand *)this);
983
984 UINT cmf = CMF_EXPLORE;
985 SFGAOF attr = SFGAO_CANRENAME;
986 hr = pFolder->GetAttributesOf(1, &pidlChild, &attr);
987 if (SUCCEEDED(hr) && (attr & SFGAO_CANRENAME))
988 cmf |= CMF_CANRENAME;
989
990 CMenuTemp menuTemp(::CreatePopupMenu());
991 UINT idCmdFirst = max(FCIDM_SHVIEWFIRST, 1);
992 hr = contextMenu->QueryContextMenu(menuTemp, 0, idCmdFirst, FCIDM_SHVIEWLAST, cmf);
994 return 0;
995
997 UINT uCommand = ::TrackPopupMenu(menuTemp, flags, pt.x, pt.y, 0, m_hWnd, NULL);
998 if (uCommand)
999 {
1000 uCommand -= idCmdFirst;
1001
1002 // Do DFM_CMD_RENAME in the treeview
1003 if ((cmf & CMF_CANRENAME) && SHELL_IsVerb(contextMenu, uCommand, L"rename"))
1004 {
1005 m_hwndTreeView.SetFocus();
1006 if (TreeView_EditLabel(m_hwndTreeView, hItem))
1007 m_oldSelected = hItem;
1008 return 0;
1009 }
1010
1011 hr = _ExecuteCommand(contextMenu, uCommand);
1012 }
1013
1014 return TRUE;
1015}
1016
1017// WM_USER_SHELLEVENT
1018LRESULT CNSCBand::OnShellEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
1019{
1020 // We use SHCNRF_NewDelivery method
1021 HANDLE hChange = (HANDLE)wParam;
1022 DWORD dwProcID = (DWORD)lParam;
1023
1024 PIDLIST_ABSOLUTE *ppidl = NULL;
1025 LONG lEvent;
1026 HANDLE hLock = SHChangeNotification_Lock(hChange, dwProcID, &ppidl, &lEvent);
1027 if (!hLock)
1028 {
1029 ERR("!hLock\n");
1030 return 0;
1031 }
1032
1033 OnChangeNotify(ppidl[0], ppidl[1], (lEvent & ~SHCNE_INTERRUPT));
1034
1036 return 0;
1037}
1038
1039// *** IOleWindow ***
1040
1041STDMETHODIMP CNSCBand::GetWindow(HWND *lphwnd)
1042{
1043 if (!lphwnd)
1044 return E_INVALIDARG;
1045 *lphwnd = m_hWnd;
1046 return S_OK;
1047}
1048
1049STDMETHODIMP CNSCBand::ContextSensitiveHelp(BOOL fEnterMode)
1050{
1052 return E_NOTIMPL;
1053}
1054
1055// *** IDockingWindow ***
1056
1057STDMETHODIMP CNSCBand::CloseDW(DWORD dwReserved)
1058{
1059 // We do nothing, we don't have anything to save yet
1060 TRACE("CloseDW called\n");
1061 return S_OK;
1062}
1063
1064STDMETHODIMP CNSCBand::ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
1065{
1066 /* Must return E_NOTIMPL according to MSDN */
1067 return E_NOTIMPL;
1068}
1069
1070STDMETHODIMP CNSCBand::ShowDW(BOOL fShow)
1071{
1072 m_fVisible = fShow;
1073 ShowWindow(fShow ? SW_SHOW : SW_HIDE);
1074 return S_OK;
1075}
1076
1077// *** IDeskBand ***
1078
1079STDMETHODIMP CNSCBand::GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi)
1080{
1081 if (!pdbi)
1082 return E_INVALIDARG;
1083
1084 m_dwBandID = dwBandID;
1085
1086 if (pdbi->dwMask & DBIM_MINSIZE)
1087 {
1088 pdbi->ptMinSize.x = 200;
1089 pdbi->ptMinSize.y = 30;
1090 }
1091
1092 if (pdbi->dwMask & DBIM_MAXSIZE)
1093 pdbi->ptMaxSize.y = -1;
1094
1095 if (pdbi->dwMask & DBIM_INTEGRAL)
1096 pdbi->ptIntegral.y = 1;
1097
1098 if (pdbi->dwMask & DBIM_ACTUAL)
1099 {
1100 pdbi->ptActual.x = 200;
1101 pdbi->ptActual.y = 30;
1102 }
1103
1104 if (pdbi->dwMask & DBIM_TITLE)
1105 {
1106 _GetTitle(pdbi->wszTitle, _countof(pdbi->wszTitle));
1107 }
1108
1109 if (pdbi->dwMask & DBIM_MODEFLAGS)
1110 pdbi->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT;
1111
1112 if (pdbi->dwMask & DBIM_BKCOLOR)
1113 pdbi->dwMask &= ~DBIM_BKCOLOR;
1114
1115 return S_OK;
1116}
1117
1118// *** IObjectWithSite ***
1119
1120STDMETHODIMP CNSCBand::SetSite(IUnknown *pUnkSite)
1121{
1122 HRESULT hr;
1123
1124 if (pUnkSite == m_pSite)
1125 return S_OK;
1126
1127 TRACE("SetSite called\n");
1128
1129 if (!pUnkSite)
1130 {
1131 DestroyWindow();
1132 m_hWnd = NULL;
1133 }
1134
1135 if (pUnkSite != m_pSite)
1136 m_pSite = NULL;
1137
1138 if (!pUnkSite)
1139 return S_OK;
1140
1142 hr = IUnknown_GetWindow(pUnkSite, &hwndParent);
1144 return E_INVALIDARG;
1145
1146 m_pSite = pUnkSite;
1147
1148 if (m_hWnd)
1149 {
1150 SetParent(hwndParent); // Change its parent
1151 }
1152 else
1153 {
1155 this->Create(hwndParent, NULL, NULL, style, 0, 0U, NULL);
1156 }
1157
1158 _RegisterChangeNotify();
1159
1160 return S_OK;
1161}
1162
1163STDMETHODIMP CNSCBand::GetSite(REFIID riid, void **ppvSite)
1164{
1165 if (!ppvSite)
1166 return E_POINTER;
1167 *ppvSite = m_pSite;
1168 return S_OK;
1169}
1170
1171// *** IOleCommandTarget ***
1172
1173STDMETHODIMP CNSCBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
1174{
1176 return E_NOTIMPL;
1177}
1178
1179STDMETHODIMP CNSCBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
1180{
1182 return E_NOTIMPL;
1183}
1184
1185// *** IServiceProvider ***
1186
1187STDMETHODIMP CNSCBand::QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
1188{
1189 return IUnknown_QueryService(m_pSite, guidService, riid, ppvObject);
1190}
1191
1192// *** IContextMenu ***
1193
1194STDMETHODIMP CNSCBand::QueryContextMenu(
1195 HMENU hmenu,
1196 UINT indexMenu,
1197 UINT idCmdFirst,
1198 UINT idCmdLast,
1199 UINT uFlags)
1200{
1202 return E_NOTIMPL;
1203}
1204
1205STDMETHODIMP CNSCBand::InvokeCommand(
1206 LPCMINVOKECOMMANDINFO lpici)
1207{
1209 return E_NOTIMPL;
1210}
1211
1212STDMETHODIMP CNSCBand::GetCommandString(
1213 UINT_PTR idCmd,
1214 UINT uType,
1215 UINT *pwReserved,
1216 LPSTR pszName,
1217 UINT cchMax)
1218{
1220 return E_NOTIMPL;
1221}
1222
1223// *** IInputObject ***
1224
1225STDMETHODIMP CNSCBand::UIActivateIO(BOOL fActivate, LPMSG lpMsg)
1226{
1227 if (fActivate)
1228 {
1229 m_hwndTreeView.SetFocus();
1230 }
1231
1232 if (lpMsg)
1233 {
1234 TranslateMessage(lpMsg);
1235 DispatchMessage(lpMsg);
1236 }
1237
1238 return S_OK;
1239}
1240
1241STDMETHODIMP CNSCBand::HasFocusIO()
1242{
1243 return m_bFocused ? S_OK : S_FALSE;
1244}
1245
1246STDMETHODIMP CNSCBand::TranslateAcceleratorIO(LPMSG lpMsg)
1247{
1248 if (lpMsg->hwnd == m_hWnd ||
1249 (m_isEditing && IsChild(lpMsg->hwnd)))
1250 {
1251 TranslateMessage(lpMsg);
1252 DispatchMessage(lpMsg);
1253 return S_OK;
1254 }
1255
1256 return S_FALSE;
1257}
1258
1259// *** IPersist ***
1260
1261STDMETHODIMP CNSCBand::GetClassID(CLSID *pClassID)
1262{
1263 return E_NOTIMPL;
1264}
1265
1266// *** IPersistStream ***
1267
1268STDMETHODIMP CNSCBand::IsDirty()
1269{
1271 return E_NOTIMPL;
1272}
1273
1274STDMETHODIMP CNSCBand::Load(IStream *pStm)
1275{
1277 return E_NOTIMPL;
1278}
1279
1280STDMETHODIMP CNSCBand::Save(IStream *pStm, BOOL fClearDirty)
1281{
1283 return E_NOTIMPL;
1284}
1285
1286STDMETHODIMP CNSCBand::GetSizeMax(ULARGE_INTEGER *pcbSize)
1287{
1289 return E_NOTIMPL;
1290}
1291
1292// *** IWinEventHandler ***
1293
1294STDMETHODIMP CNSCBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
1295{
1296 return S_OK;
1297}
1298
1299STDMETHODIMP CNSCBand::IsWindowOwner(HWND hWnd)
1300{
1301 return SHIsChildOrSelf(m_hWnd, hWnd);
1302}
1303
1304// *** IBandNavigate ***
1305
1306STDMETHODIMP CNSCBand::Select(LPCITEMIDLIST pidl)
1307{
1309 return E_NOTIMPL;
1310}
1311
1312// *** INamespaceProxy ***
1313
1314// Returns the ITEMIDLIST that should be navigated when an item is invoked.
1315STDMETHODIMP CNSCBand::GetNavigateTarget(
1317 _Out_ PIDLIST_ABSOLUTE *ppidlTarget,
1318 _Out_ ULONG *pulAttrib)
1319{
1320 *pulAttrib = 0;
1322 if (!SHGetPathFromIDListW(pidl, szPath))
1323 return E_FAIL;
1324
1325 if (lstrcmpiW(PathFindExtensionW(szPath), L".lnk") == 0) // shortcut file?
1326 {
1327 WCHAR szTarget[MAX_PATH];
1328 HRESULT hr = SHDOCVW_GetPathOfShortcut(m_hWnd, szPath, szTarget);
1329 if (SUCCEEDED(hr))
1330 {
1331 lstrcpynW(szPath, szTarget, _countof(szPath));
1332 *pulAttrib |= SFGAO_LINK;
1333 }
1334 }
1335
1337 *pulAttrib |= SFGAO_FOLDER;
1338
1339 *ppidlTarget = ILCreateFromPathW(szPath);
1340 return S_OK;
1341}
1342
1343// Handles a user action on an item.
1344STDMETHODIMP CNSCBand::Invoke(_In_ PCIDLIST_ABSOLUTE pidl)
1345{
1347 return E_NOTIMPL;
1348}
1349
1350// Called when the user has selected an item.
1351STDMETHODIMP CNSCBand::OnSelectionChanged(_In_ PCIDLIST_ABSOLUTE pidl)
1352{
1353 return S_OK;
1354}
1355
1356// Returns flags used to update the tree control.
1357STDMETHODIMP CNSCBand::RefreshFlags(
1358 _Out_ DWORD *pdwStyle,
1359 _Out_ DWORD *pdwExStyle,
1360 _Out_ DWORD *dwEnum)
1361{
1362 *pdwStyle = _GetTVStyle();
1363 *pdwExStyle = _GetTVExStyle();
1364 *dwEnum = _GetEnumFlags();
1365 return S_OK;
1366}
1367
1368STDMETHODIMP CNSCBand::CacheItem(
1370{
1372 return E_NOTIMPL;
1373}
1374
1375// *** IDropTarget methods ***
1376STDMETHODIMP CNSCBand::DragEnter(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect)
1377{
1378 ERR("Entering drag\n");
1379 m_pCurObject = pObj;
1380 m_oldSelected = TreeView_GetSelection(m_hwndTreeView);
1381 return DragOver(glfKeyState, pt, pdwEffect);
1382}
1383
1384STDMETHODIMP CNSCBand::DragOver(DWORD glfKeyState, POINTL pt, DWORD *pdwEffect)
1385{
1387 info.pt.x = pt.x;
1388 info.pt.y = pt.y;
1389 info.flags = TVHT_ONITEM;
1390 info.hItem = NULL;
1391 ScreenToClient(&info.pt);
1392
1393 // Move to the item selected by the treeview (don't change right pane)
1394 TreeView_HitTest(m_hwndTreeView, &info);
1395
1396 HRESULT hr;
1397 if (!info.hItem)
1398 {
1399 m_childTargetNode = NULL;
1400 m_pDropTarget = NULL;
1401 *pdwEffect = DROPEFFECT_NONE;
1402 return S_OK;
1403 }
1404
1405 ++m_mtxBlockNavigate;
1406 TreeView_SelectItem(m_hwndTreeView, info.hItem);
1407 --m_mtxBlockNavigate;
1408
1409 // Delegate to shell folder
1410 if (m_pDropTarget && info.hItem != m_childTargetNode)
1411 m_pDropTarget = NULL;
1412
1413 if (info.hItem != m_childTargetNode)
1414 {
1415 CItemData *pItemData = GetItemData(info.hItem);
1416 if (!pItemData)
1417 return E_FAIL;
1418
1419 CComPtr<IShellFolder> pFolder;
1420 if (_ILIsDesktop(pItemData->absolutePidl))
1421 {
1422 pFolder = m_pDesktop;
1423 }
1424 else
1425 {
1426 hr = m_pDesktop->BindToObject(pItemData->absolutePidl, 0, IID_PPV_ARG(IShellFolder, &pFolder));
1427 if (!SUCCEEDED(hr))
1428 {
1429 /* Don't allow dnd since we couldn't get our folder object */
1430 ERR("Can't bind to folder object\n");
1431 *pdwEffect = DROPEFFECT_NONE;
1432 return E_FAIL;
1433 }
1434 }
1435
1436 hr = pFolder->CreateViewObject(m_hWnd, IID_PPV_ARG(IDropTarget, &m_pDropTarget));
1437 if (!SUCCEEDED(hr))
1438 {
1439 /* Don't allow dnd since we couldn't get our drop target */
1440 ERR("Can't get drop target for folder object\n");
1441 *pdwEffect = DROPEFFECT_NONE;
1442 return E_FAIL;
1443 }
1444
1445 hr = m_pDropTarget->DragEnter(m_pCurObject, glfKeyState, pt, pdwEffect);
1446 m_childTargetNode = info.hItem;
1447 }
1448
1449 if (m_pDropTarget)
1450 hr = m_pDropTarget->DragOver(glfKeyState, pt, pdwEffect);
1451
1452 return S_OK;
1453}
1454
1455STDMETHODIMP CNSCBand::DragLeave()
1456{
1457 ++m_mtxBlockNavigate;
1458 TreeView_SelectItem(m_hwndTreeView, m_oldSelected);
1459 --m_mtxBlockNavigate;
1460 m_childTargetNode = NULL;
1461 if (m_pCurObject)
1462 m_pCurObject = NULL;
1463 return S_OK;
1464}
1465
1466STDMETHODIMP CNSCBand::Drop(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect)
1467{
1468 if (!m_pDropTarget)
1469 return E_FAIL;
1470 m_pDropTarget->Drop(pObj, glfKeyState, pt, pdwEffect);
1471 DragLeave();
1472 return S_OK;
1473}
1474
1475// *** IDropSource methods ***
1476
1477STDMETHODIMP CNSCBand::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
1478{
1479 if (fEscapePressed)
1480 return DRAGDROP_S_CANCEL;
1481 if ((grfKeyState & MK_LBUTTON) || (grfKeyState & MK_RBUTTON))
1482 return S_OK;
1483 return DRAGDROP_S_DROP;
1484}
1485
1486STDMETHODIMP CNSCBand::GiveFeedback(DWORD dwEffect)
1487{
1489}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define TIMER_ID_REFRESH
Definition: CNSCBand.cpp:13
static HRESULT SHDOCVW_GetCurrentLocationFromView(_In_ IShellView &View, _In_ PIDLIST_ABSOLUTE *ppidl)
Definition: CNSCBand.cpp:115
HRESULT SHDOCVW_CreateShortcut(_In_ LPCWSTR pszLnkFileName, _In_ PCIDLIST_ABSOLUTE pidlTarget, _In_opt_ LPCWSTR pszDescription)
Definition: CNSCBand.cpp:49
#define TARGET_EVENTS
HRESULT SHDOCVW_GetPathOfShortcut(_In_opt_ HWND hWnd, _In_ LPCWSTR pszLnkFile, _Out_ LPWSTR pszPath)
Definition: CNSCBand.cpp:19
#define WM_USER_SHELLEVENT
Definition: CNSCBand.h:12
UINT cchMax
Arabic default style
Definition: afstyles.h:94
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define U(x)
Definition: wordpad.c:45
@ Create
Definition: registry.c:563
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define STDMETHODIMP
Definition: basetyps.h:43
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
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)
EXTERN_C BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
Definition: fxobject.cpp:255
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:900
static HWND hwndParent
Definition: cryptui.c:300
static TAGID TAGID find
Definition: db.cpp:155
#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
static BOOL OnEndLabelEdit(NMLVDISPINFO *pnmv)
Definition: environment.c:666
static BOOL OnBeginLabelEdit(NMLVDISPINFO *pnmv)
Definition: environment.c:650
static HINSTANCE instance
Definition: main.c:40
UINT uFlags
Definition: api.c:59
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define MAX_PATH
Definition: compat.h:34
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4262
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
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
#define ID_ADD
Definition: resource.h:9
#define IDW_TREEVIEW
Definition: resource.h:7
#define ID_ORGANIZE
Definition: resource.h:10
EXTERN_C BOOL SHELL_IsVerb(IContextMenu *pcm, UINT_PTR idCmd, LPCWSTR Verb)
Definition: utility.cpp:58
EXTERN_C BOOL SHELL_IsEqualAbsoluteID(PCIDLIST_ABSOLUTE a, PCIDLIST_ABSOLUTE b)
Definition: utility.cpp:52
EXTERN_C HRESULT SHELL_GetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: utility.cpp:18
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3150
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3092
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1501
BOOL WINAPI SHIsChildOrSelf(HWND hParent, HWND hChild)
Definition: ordinal.c:2254
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1336
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4783
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1411
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
BOOL WINAPI PathIsRootW(LPCWSTR lpszPath)
Definition: path.c:1648
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1783
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1729
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1530
#define pt(x, y)
Definition: drawing.c:79
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxObject * pParent
Definition: fxdpcapi.cpp:86
GLbitfield flags
Definition: glext.h:7161
int WINAPI SHMapPIDLToSystemImageListIndex(IShellFolder *sh, LPCITEMIDLIST pidl, int *pIndex)
Definition: iconcache.cpp:772
REFIID riid
Definition: atlbase.h:39
HRESULT GetAttributesOf([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
ULONG AddRef()
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#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
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
LPCWSTR szPath
Definition: env.c:37
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static ATOM item
Definition: dde.c:856
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
_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 _Out_opt_
Definition: no_sal2.h:214
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define DWORD
Definition: nt_native.h:44
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
#define STGM_READ
Definition: objbase.h:917
const GUID IID_IDataObject
#define PathAddExtensionW
Definition: pathcch.h:305
#define PathAppendW
Definition: pathcch.h:309
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
short SHORT
Definition: pedump.c:59
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:1044
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:816
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1462
BOOL WINAPI ILGetDisplayName(LPCITEMIDLIST pidl, LPVOID path)
Definition: pidl.c:183
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1454
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1101
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:582
#define TVN_DELETEITEM
Definition: commctrl.h:3747
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TVHT_NOWHERE
Definition: commctrl.h:3529
#define TVN_SELCHANGED
Definition: commctrl.h:3740
#define TVHT_BELOW
Definition: commctrl.h:3539
#define TVN_BEGINDRAG
Definition: commctrl.h:3745
#define TVI_LAST
Definition: commctrl.h:3375
#define TreeView_DeleteAllItems(hwnd)
Definition: commctrl.h:3422
#define TVHT_ABOVE
Definition: commctrl.h:3538
#define TB_AUTOSIZE
Definition: commctrl.h:1137
#define TVIF_TEXT
Definition: commctrl.h:3271
#define TreeView_SelectItem(hwnd, hitem)
Definition: commctrl.h:3486
#define TVHT_ONITEM
Definition: commctrl.h:3532
#define ICC_TREEVIEW_CLASSES
Definition: commctrl.h:59
#define TreeView_GetChild(hwnd, hitem)
Definition: commctrl.h:3471
#define TVIF_IMAGE
Definition: commctrl.h:3272
#define TVIS_EXPANDEDONCE
Definition: commctrl.h:3290
#define TVSIL_NORMAL
Definition: commctrl.h:3448
#define LPNMTREEVIEW
Definition: commctrl.h:3648
#define TreeView_GetItemState(hwndTV, hti, mask)
Definition: commctrl.h:3600
#define TVHT_ONITEMBUTTON
Definition: commctrl.h:3534
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TreeView_GetParent(hwnd, hitem)
Definition: commctrl.h:3474
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3478
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3495
#define NM_CLICK
Definition: commctrl.h:130
#define TreeView_GetItemRect(hwnd, hitem, prc, code)
Definition: commctrl.h:3434
#define TVE_EXPAND
Definition: commctrl.h:3428
#define TV_INSERTSTRUCT
Definition: commctrl.h:3382
#define TVI_ROOT
Definition: commctrl.h:3373
#define TV_ITEMW
Definition: commctrl.h:3302
#define TVN_BEGINRDRAG
Definition: commctrl.h:3746
#define WC_TREEVIEWW
Definition: commctrl.h:3248
#define TVIF_HANDLE
Definition: commctrl.h:3275
#define TVE_COLLAPSE
Definition: commctrl.h:3427
#define TreeView_GetNextSibling(hwnd, hitem)
Definition: commctrl.h:3472
#define TVIS_EXPANDED
Definition: commctrl.h:3289
#define NM_RCLICK
Definition: commctrl.h:133
#define TVN_ITEMEXPANDING
Definition: commctrl.h:3743
#define TVN_BEGINLABELEDITW
Definition: commctrl.h:3715
#define TreeView_EditLabel(hwnd, hitem)
Definition: commctrl.h:3509
#define TVIF_PARAM
Definition: commctrl.h:3273
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define LPNMTVDISPINFO
Definition: commctrl.h:3681
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3452
#define TVIF_CHILDREN
Definition: commctrl.h:3277
#define TreeView_HitTest(hwnd, lpht)
Definition: commctrl.h:3518
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3417
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3276
#define TVN_ENDLABELEDITW
Definition: commctrl.h:3717
#define TreeView_SetItem(hwnd, pitem)
Definition: commctrl.h:3502
#define TVIF_STATE
Definition: commctrl.h:3274
#define TreeView_DeleteItem(hwnd, hitem)
Definition: commctrl.h:3420
#define REFIID
Definition: guiddef.h:118
static void SHDOCVW_LockModule(void)
Definition: shdocvw.h:59
static void SHDOCVW_UnlockModule(void)
Definition: shdocvw.h:60
#define SHIL_SMALL
Definition: shellapi.h:186
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
Definition: shellord.c:2673
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2452
HRESULT hr
Definition: shlfolder.c:183
#define SID_SShellBrowser
Definition: shlguid.h:128
#define SHCNE_DRIVEREMOVED
Definition: shlobj.h:1897
#define SHCNE_RMDIR
Definition: shlobj.h:1894
#define SHCNE_DELETE
Definition: shlobj.h:1892
#define SHCNE_MKDIR
Definition: shlobj.h:1893
#define SHCNE_UPDATEITEM
Definition: shlobj.h:1903
#define CSIDL_FAVORITES
Definition: shlobj.h:2179
#define SHCNE_RENAMEITEM
Definition: shlobj.h:1890
#define SHCNE_UPDATEDIR
Definition: shlobj.h:1902
#define SHCNE_CREATE
Definition: shlobj.h:1891
#define SHCNE_RENAMEFOLDER
Definition: shlobj.h:1907
#define SHCNRF_NewDelivery
Definition: shlobj.h:1938
#define SHCNRF_ShellLevel
Definition: shlobj.h:1936
#define SHCNE_DRIVEADD
Definition: shlobj.h:1898
#define SHCNE_ASSOCCHANGED
Definition: shlobj.h:1911
#define FCIDM_SHVIEWFIRST
Definition: shlobj.h:580
#define SHCNE_INTERRUPT
Definition: shlobj.h:1915
#define FCIDM_SHVIEWLAST
Definition: shlobj.h:614
#define SHCNF_IDLIST
Definition: shlobj.h:1921
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
HMENU m_hMenu
Definition: CNSCBand.cpp:922
CMenuTemp(HMENU hMenu)
Definition: CNSCBand.cpp:923
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:2497
HWND hwnd
Definition: winuser.h:3117
UINT code
Definition: winuser.h:3162
HWND hwndFrom
Definition: winuser.h:3160
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
HTREEITEM hItem
Definition: commctrl.h:3526
LPARAM lParam
Definition: commctrl.h:3330
int cChildren
Definition: commctrl.h:3329
#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
static HMENU hmenu
Definition: win.c:66
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_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 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 E_POINTER
Definition: winerror.h:2365
#define SW_SHOWNORMAL
Definition: winuser.h:773
#define MK_RBUTTON
Definition: winuser.h:2371
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define SW_HIDE
Definition: winuser.h:771
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define TPM_RIGHTBUTTON
Definition: winuser.h:2383
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
#define VK_CONTROL
Definition: winuser.h:2206
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2756
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define TPM_LEFTALIGN
Definition: winuser.h:2380
#define TPM_LEFTBUTTON
Definition: winuser.h:2382
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MK_LBUTTON
Definition: winuser.h:2370
#define VK_SHIFT
Definition: winuser.h:2205
#define SW_SHOW
Definition: winuser.h:778
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define DispatchMessage
Definition: winuser.h:5777
#define TPM_RETURNCMD
Definition: winuser.h:2390
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:1619
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define IID_PPV_ARG(Itype, ppType)
#define IID_NULL_PPV_ARG(Itype, ppType)
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185