ReactOS 0.4.15-dev-8231-g29a56f3
brfolder.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS shell32
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: SHBrowseForFolderA/W functions
5 * COPYRIGHT: Copyright 1999 Juergen Schmied
6 * Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7 */
8
9// FIXME: Many flags unimplemented
10
11#include "precomp.h"
12
13#include <ui/layout.h> // Resizable window
14
16
17#define SHV_CHANGE_NOTIFY (WM_USER + 0x1111)
18
20{
25 LAYOUT_DATA* layout; // Filled by LayoutInit, used by LayoutUpdate
27 ULONG hChangeNotify; // Change notification handle
28 IContextMenu* pContextMenu; // Active context menu
29};
30
32{
33 CComPtr<IShellFolder> lpsfParent; // IShellFolder of the parent
34 PCIDLIST_RELATIVE pidlChild; // PIDL relative to parent
36};
37
38static const LAYOUT_INFO g_layout_info[] =
39{
45 { IDOK, BF_BOTTOM | BF_RIGHT },
47};
48
49#define SUPPORTED_FLAGS (BIF_STATUSTEXT | BIF_BROWSEFORCOMPUTER | BIF_RETURNFSANCESTORS | \
50 BIF_RETURNONLYFSDIRS | BIF_NONEWFOLDERBUTTON | BIF_NEWDIALOGSTYLE | \
51 BIF_BROWSEINCLUDEFILES)
52
53static HTREEITEM
57 _In_ PCUITEMID_CHILD pidlChild,
58 _In_ PCIDLIST_ABSOLUTE pidlParent,
59 _In_ HTREEITEM hParent);
60
61static inline DWORD
63{
64 return SHCONTF_FOLDERS | ((ulFlags & BIF_BROWSEINCLUDEFILES) ? SHCONTF_NONFOLDERS : 0);
65}
66
67static void
69{
70 if (!lpBrowseInfo->lpfn)
71 return;
72 lpBrowseInfo->lpfn(hWnd, uMsg, lParam, lpBrowseInfo->lParam);
73}
74
75static BrItemData *
77{
79 item.hItem = hItem;
80 if (!TreeView_GetItem(info->hwndTreeView, &item))
81 {
82 ERR("TreeView_GetItem failed\n");
83 return NULL;
84 }
85 return (BrItemData *)item.lParam;
86}
87
88static SFGAOF
90{
92 HRESULT hr = item ? item->lpsfParent->GetAttributesOf(1, &item->pidlChild, &Att) : E_FAIL;
93 return SUCCEEDED(hr) ? Att : 0;
94}
95
96static HRESULT
99 _In_ BrItemData *pItemData,
100 _Outptr_opt_ IEnumIDList **ppEnum)
101{
102 if (!pItemData)
103 return E_FAIL;
104
105 CComPtr<IEnumIDList> pEnumIL;
106 PCUITEMID_CHILD pidlRef = pItemData->pidlChild;
107 ULONG attrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
108 IShellFolder *lpsf = pItemData->lpsfParent;
109 HRESULT hr = lpsf->GetAttributesOf(1, &pidlRef, &attrs);
110 if (FAILED_UNEXPECTEDLY(hr) || !(attrs & SFGAO_FOLDER))
111 return E_FAIL;
112
113 CComPtr<IShellFolder> psfChild;
114 if (_ILIsDesktop(pItemData->pidlFull))
115 hr = SHGetDesktopFolder(&psfChild);
116 else
117 hr = lpsf->BindToObject(pidlRef, NULL, IID_PPV_ARG(IShellFolder, &psfChild));
119 return E_FAIL;
120
121 DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
122 hr = psfChild->EnumObjects(info->hWnd, flags, &pEnumIL);
123 if (hr == S_OK)
124 {
125 if ((pEnumIL->Skip(1) != S_OK) || FAILED(pEnumIL->Reset()))
126 pEnumIL = NULL;
127 }
128
129 if (!pEnumIL || !(attrs & SFGAO_HASSUBFOLDER))
130 return E_FAIL; // No children
131
132 if (ppEnum)
133 *ppEnum = pEnumIL.Detach();
134
135 return S_OK; // There are children
136}
137
138/******************************************************************************
139 * BrFolder_InitTreeView [Internal]
140 *
141 * Called from WM_INITDIALOG handler.
142 */
143static void
145{
146 HIMAGELIST hImageList;
147 HRESULT hr;
148 CComPtr<IShellFolder> lpsfParent;
149 CComPtr<IEnumIDList> pEnumChildren;
151
152 Shell_GetImageLists(NULL, &hImageList);
153
154 if (hImageList)
155 TreeView_SetImageList(info->hwndTreeView, hImageList, 0);
156
157 /* We want to call BrFolder_InsertItem down the code, in order to insert
158 * the root item of the treeview. Due to BrFolder_InsertItem's signature,
159 * we need the following to do this:
160 *
161 * + An ITEMIDLIST corresponding to _the parent_ of root.
162 * + An ITEMIDLIST, which is a relative path from root's parent to root
163 * (containing a single SHITEMID).
164 * + An IShellFolder interface pointer of root's parent folder.
165 *
166 * If root is 'Desktop', then root's parent is also 'Desktop'.
167 */
168
169 PCIDLIST_ABSOLUTE pidlRoot = info->lpBrowseInfo->pidlRoot;
170 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidlParent(ILClone(pidlRoot));
171 ILRemoveLastID(pidlParent);
172 PCIDLIST_RELATIVE pidlChild = ILFindLastID(pidlRoot);
173
174 if (_ILIsDesktop(pidlParent))
175 {
176 hr = SHGetDesktopFolder(&lpsfParent);
178 return;
179 }
180 else
181 {
182 CComPtr<IShellFolder> lpsfDesktop;
183 hr = SHGetDesktopFolder(&lpsfDesktop);
185 return;
186
187 hr = lpsfDesktop->BindToObject(pidlParent, NULL, IID_PPV_ARG(IShellFolder, &lpsfParent));
189 return;
190 }
191
192 TreeView_DeleteItem(info->hwndTreeView, TVI_ROOT);
193 hItem = BrFolder_InsertItem(info, lpsfParent, pidlChild, pidlParent, TVI_ROOT);
194 TreeView_Expand(info->hwndTreeView, hItem, TVE_EXPAND);
195}
196
197static INT
199{
200 SHFILEINFOW sfi;
201 SHGetFileInfoW((LPCWSTR)pidl, 0, &sfi, sizeof(sfi), uFlags);
202 return sfi.iIcon;
203}
204
205static void
207{
208 DWORD flags;
209
211 if (!pidl)
212 {
213 pidlDesktop.Attach(_ILCreateDesktop());
214 pidl = pidlDesktop;
215 }
216
218 pItem->iImage = BrFolder_GetIcon(pidl, flags);
219
221 pItem->iSelectedImage = BrFolder_GetIcon(pidl, flags);
222}
223
224/******************************************************************************
225 * BrFolder_GetName [Internal]
226 *
227 * Query a shell folder for the display name of one of its children
228 *
229 * PARAMS
230 * lpsf [I] IShellFolder interface of the folder to be queried.
231 * pidlChild [I] ITEMIDLIST of the child, relative to parent
232 * dwFlags [I] as in IShellFolder::GetDisplayNameOf
233 * lpFriendlyName [O] The desired display name in unicode
234 *
235 * RETURNS
236 * Success: TRUE
237 * Failure: FALSE
238 */
239static BOOL
241 IShellFolder *lpsf,
242 PCIDLIST_RELATIVE pidlChild,
244 LPWSTR lpFriendlyName)
245{
247 STRRET str;
248
249 TRACE("%p %p %x %p\n", lpsf, pidlChild, dwFlags, lpFriendlyName);
250 if (!FAILED_UNEXPECTEDLY(lpsf->GetDisplayNameOf(pidlChild, dwFlags, &str)))
251 bSuccess = StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, pidlChild);
252
253 TRACE("-- %s\n", debugstr_w(lpFriendlyName));
254 return bSuccess;
255}
256
257static BOOL
261 _Inout_ IEnumIDList *pEnum)
262{
264 if (!pItemData)
265 return FALSE;
266
267 pEnum->Reset();
268
270 while (pEnum->Next(1, &pidlTemp, NULL) == S_OK)
271 {
272 if (ILIsEqual(pidlTemp, pItemData->pidlChild))
273 return TRUE;
274
275 pidlTemp.Free();
276 }
277
278 return FALSE;
279}
280
281static BOOL
285 _Outptr_opt_ PITEMID_CHILD pidlChild)
286{
287 for (hItem = TreeView_GetChild(info->hwndTreeView, hItem); hItem;
288 hItem = TreeView_GetNextSibling(info->hwndTreeView, hItem))
289 {
291 if (ILIsEqual(pItemData->pidlChild, pidlChild))
292 return TRUE;
293 }
294
295 return FALSE;
296}
297
298static void
302{
304 if (!pItemData)
305 return;
306
308 item.hItem = hItem;
309
310 BrFolder_GetIconPair(pItemData->pidlFull, &item);
311
312 item.cChildren = 0;
314 if (BrFolder_GetChildrenEnum(info, pItemData, &pEnum) == S_OK)
315 {
317 if (pEnum->Next(1, &pidlTemp, NULL) == S_OK)
318 ++item.cChildren;
319 }
320
321 TreeView_SetItem(info->hwndTreeView, &item);
322}
323
324/******************************************************************************
325 * BrFolder_InsertItem [Internal]
326 *
327 * PARAMS
328 * info [I] data for the dialog
329 * lpsf [I] IShellFolder interface of the item's parent shell folder
330 * pidlChild [I] ITEMIDLIST of the child to insert, relative to parent
331 * pidlParent [I] ITEMIDLIST of the parent shell folder
332 * hParent [I] The treeview-item that represents the parent shell folder
333 *
334 * RETURNS
335 * Success: Handle to the created and inserted treeview-item
336 * Failure: NULL
337 */
338static HTREEITEM
341 _Inout_ IShellFolder *lpsf,
342 _In_ PCUITEMID_CHILD pidlChild,
343 _In_ PCIDLIST_ABSOLUTE pidlParent,
344 _In_ HTREEITEM hParent)
345{
347 if (!BrFolder_GetName(lpsf, pidlChild, SHGDN_NORMAL, szName))
348 return NULL;
349
350 BrItemData *pItemData = new BrItemData();
351
353 item.pszText = szName;
354 item.cchTextMax = _countof(szName);
355 item.lParam = (LPARAM)pItemData;
356
357 PIDLIST_ABSOLUTE pidlFull =
358 (pidlParent ? ILCombine(pidlParent, pidlChild) : ILClone(pidlChild));
359 BrFolder_GetIconPair(pidlFull, &item);
360
361 pItemData->lpsfParent = lpsf;
362 pItemData->pidlFull.Attach(pidlFull);
363 pItemData->pidlChild = ILFindLastID(pItemData->pidlFull);
364
365 if (BrFolder_GetChildrenEnum(info, pItemData, NULL) == S_OK)
366 item.cChildren = 1;
367
368 TVINSERTSTRUCTW tvins = { hParent };
369 tvins.item = item;
370 return TreeView_InsertItem(info->hwndTreeView, &tvins);
371}
372
373/******************************************************************************
374 * BrFolder_Expand [Internal]
375 *
376 * For each child (given by pEnum) of the parent shell folder, which is given by
377 * lpsf and whose PIDL is pidl, insert a treeview-item right under hParent
378 *
379 * PARAMS
380 * info [I] data for the dialog
381 * lpsf [I] IShellFolder interface of the parent shell folder
382 * pidl [I] ITEMIDLIST of the parent shell folder
383 * hParent [I] The treeview item that represents the parent shell folder
384 * pEnum [I] An iterator for the children of the parent shell folder
385 */
386static void
389 _In_ IShellFolder *lpsf,
390 _In_ PCIDLIST_ABSOLUTE pidlFull,
391 _In_ HTREEITEM hParent)
392{
393 TRACE("%p %p %p\n", lpsf, pidlFull, hParent);
394
395 // No IEnumIDList -> No children
396 BrItemData *pItemData = BrFolder_GetItemData(info, hParent);
398 HRESULT hr = BrFolder_GetChildrenEnum(info, pItemData, &pEnum);
399 if (FAILED(hr))
400 return;
401
402 SetCapture(info->hWnd);
404
406 ULONG ulFetched;
407 while (S_OK == pEnum->Next(1, &pidlTemp, &ulFetched))
408 {
409 if (!BrFolder_InsertItem(info, lpsf, pidlTemp, pidlFull, hParent))
410 break;
411 pidlTemp.Free(); // Finally, free the pidl that the shell gave us...
412 }
413
416}
417
418static inline BOOL
420{
422 if (!data)
423 return FALSE;
424 return (data->type == type);
425}
426
427static void
429{
430 LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
431 PCIDLIST_RELATIVE pidlChild = pItemData->pidlChild;
433 HRESULT hr;
434
435 BOOL bEnabled = TRUE;
436 if ((lpBrowseInfo->ulFlags & BIF_BROWSEFORCOMPUTER) && !PIDLIsType(pidlChild, PT_COMP))
437 bEnabled = FALSE;
438
439 if (lpBrowseInfo->ulFlags & BIF_RETURNFSANCESTORS)
440 {
441 dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM;
442 hr = pItemData->lpsfParent->GetAttributesOf(1, &pidlChild, &dwAttributes);
443 if (FAILED(hr) || !(dwAttributes & (SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM)))
444 bEnabled = FALSE;
445 }
446
447 dwAttributes = SFGAO_FOLDER | SFGAO_FILESYSTEM;
448 hr = pItemData->lpsfParent->GetAttributesOf(1, &pidlChild, &dwAttributes);
449 if (FAILED_UNEXPECTEDLY(hr) ||
450 ((dwAttributes & (SFGAO_FOLDER | SFGAO_FILESYSTEM)) != (SFGAO_FOLDER | SFGAO_FILESYSTEM)))
451 {
452 if (lpBrowseInfo->ulFlags & BIF_RETURNONLYFSDIRS)
453 bEnabled = FALSE;
455 }
456 else
457 {
459 }
460
461 SendMessageW(info->hWnd, BFFM_ENABLEOK, 0, bEnabled);
462}
463
464static LRESULT
466{
467 BrItemData *pItemData = (BrItemData *)pnmtv->itemOld.lParam;
468
469 TRACE("TVN_DELETEITEMA/W %p\n", pItemData);
470
471 delete pItemData;
472 return 0;
473}
474
475static LRESULT
477{
478 BrItemData *pItemData = (BrItemData *)pnmtv->itemNew.lParam;
479
480 TRACE("TVN_ITEMEXPANDINGA/W\n");
481
482 if ((pnmtv->itemNew.state & TVIS_EXPANDEDONCE))
483 return 0;
484
485 HRESULT hr = S_OK;
487 if (!_ILIsEmpty(pItemData->pidlChild))
488 {
489 hr = pItemData->lpsfParent->BindToObject(pItemData->pidlChild, NULL,
490 IID_PPV_ARG(IShellFolder, &lpsf2));
491 }
492 else
493 {
494 lpsf2 = pItemData->lpsfParent;
495 }
496
497 HTREEITEM hItem = pnmtv->itemNew.hItem;
499 BrFolder_Expand(info, lpsf2, pItemData->pidlFull, hItem);
500
501 // My Computer is already sorted and trying to do a simple text
502 // sort will only mess things up
503 if (!_ILIsMyComputer(pItemData->pidlChild))
504 TreeView_SortChildren(info->hwndTreeView, hItem, FALSE);
505
506 return 0;
507}
508
509static HRESULT
511{
512 BrItemData *pItemData = (BrItemData *)pnmtv->itemNew.lParam;
513
514 ILFree(info->pidlRet);
515 info->pidlRet = ILClone(pItemData->pidlFull);
516
518 if (BrFolder_GetName(pItemData->lpsfParent, pItemData->pidlChild, SHGDN_NORMAL, szName))
520
521 BrFolder_Callback(info->lpBrowseInfo, info->hWnd, BFFM_SELCHANGED, (LPARAM)info->pidlRet);
523 return S_OK;
524}
525
526static LRESULT
528{
529 if (!pnmtv->item.pszText)
530 return FALSE;
531
532 HTREEITEM hItem = TreeView_GetSelection(info->hwndTreeView);
534 ASSERT(data);
535 ASSERT(BrFolder_GetItemAttributes(info, hItem, SFGAO_CANRENAME) & SFGAO_CANRENAME);
536
537 PITEMID_CHILD newChild;
538 HRESULT hr = data->lpsfParent->SetNameOf(info->hWnd, data->pidlChild,
539 pnmtv->item.pszText, SHGDN_NORMAL, &newChild);
540 if (FAILED(hr))
541 return FALSE;
542
543 LPITEMIDLIST newFull;
544 if (SUCCEEDED(hr = SHILClone(data->pidlFull, &newFull)))
545 {
546 ILRemoveLastID(newFull);
547 if (SUCCEEDED(hr = SHILAppend(newChild, &newFull)))
548 {
549 data->pidlFull.Free();
550 data->pidlFull.Attach(newFull);
551 data->pidlChild = ILFindLastID(data->pidlFull);
552 }
553 newChild = NULL; // SHILAppend is nuts and frees this
554 }
555 ILFree(newChild);
556
557 NMTREEVIEWW nmtv;
558 nmtv.itemNew.lParam = (LPARAM)data;
560 return TRUE;
561}
562
563static HRESULT
565{
566 TreeView_SelectItem(info->hwndTreeView, hItem);
567 TreeView_EditLabel(info->hwndTreeView, hItem);
568 return S_OK;
569}
570
571static void
573{
574 SHFILEOPSTRUCTW fileop = { info->hwndTreeView };
575 WCHAR szzFrom[MAX_PATH + 1];
576
577 // Get item_data
579
580 // Get the path
581 if (!SHGetPathFromIDListW(item_data->pidlFull, szzFrom))
582 {
583 ERR("SHGetPathFromIDListW failed\n");
584 return;
585 }
586 szzFrom[lstrlenW(szzFrom) + 1] = UNICODE_NULL; // Double NULL-terminated
587 fileop.pFrom = szzFrom;
588
589 // Delete folder
590 fileop.fFlags = FOF_ALLOWUNDO;
591 fileop.wFunc = FO_DELETE;
592 SHFileOperationW(&fileop);
593}
594
595static void
597
598static LRESULT
600{
601 // Old dialog doesn't support those advanced features
602 if (!(info->lpBrowseInfo->ulFlags & BIF_USENEWUI))
603 return 0;
604
605 HTREEITEM hItem = TreeView_GetSelection(info->hwndTreeView);
606
607 switch (keydown->wVKey)
608 {
609 case VK_F2:
611 break;
612 case VK_DELETE:
614 break;
615 case 'R':
616 {
617 if (GetKeyState(VK_CONTROL) < 0) // Ctrl+R
619 break;
620 }
621 case VK_F5:
622 {
624 break;
625 }
626 }
627 return 0;
628}
629
630static LRESULT
632{
633 NMTREEVIEWW *pnmtv = (NMTREEVIEWW *)lpnmh;
634
635 TRACE("%p %x %p msg=%x\n", info, CtlID, lpnmh, pnmtv->hdr.code);
636
638 return 0;
639
640 switch (pnmtv->hdr.code)
641 {
642 case TVN_DELETEITEMA:
643 case TVN_DELETEITEMW:
644 return BrFolder_Treeview_Delete(info, pnmtv);
645
648 return BrFolder_Treeview_Expand(info, pnmtv);
649
650 case TVN_SELCHANGEDA:
651 case TVN_SELCHANGEDW:
652 return BrFolder_Treeview_Changed(info, pnmtv);
653
656 {
657 NMTVDISPINFO &tvdi = *(NMTVDISPINFO*)lpnmh;
658 UINT att = BrFolder_GetItemAttributes(info, tvdi.item.hItem, SFGAO_CANRENAME);
659 return !(att & SFGAO_CANRENAME);
660 }
661
664
665 case TVN_KEYDOWN:
667
668 default:
669 WARN("unhandled (%d)\n", pnmtv->hdr.code);
670 break;
671 }
672
673 return 0;
674}
675
676static BOOL
678{
681 LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
682
683 info->hWnd = hWnd;
684 SetPropW(hWnd, L"__WINE_BRSFOLDERDLG_INFO", info);
685
686 if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
687 FIXME("flags BIF_NEWDIALOGSTYLE partially implemented\n");
688
689 if (lpBrowseInfo->ulFlags & ~SUPPORTED_FLAGS)
690 FIXME("flags %x not implemented\n", (lpBrowseInfo->ulFlags & ~SUPPORTED_FLAGS));
691
692 info->layout = NULL;
693 if (lpBrowseInfo->ulFlags & BIF_USENEWUI)
694 {
695 RECT rcWnd;
696
697 // Resize the treeview if there's not editbox
698 if ((lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE) &&
699 !(lpBrowseInfo->ulFlags & BIF_EDITBOX))
700 {
701 RECT rcEdit, rcTreeView;
704 LONG cy = rcTreeView.top - rcEdit.top;
705 MapWindowPoints(NULL, hWnd, (LPPOINT)&rcTreeView, sizeof(RECT) / sizeof(POINT));
706 rcTreeView.top -= cy;
708 rcTreeView.left, rcTreeView.top,
709 rcTreeView.right - rcTreeView.left,
710 rcTreeView.bottom - rcTreeView.top, TRUE);
711 }
712
713 if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
715
716 // TODO: Windows allows shrinking the windows a bit
717 GetWindowRect(hWnd, &rcWnd);
718 info->szMin.cx = rcWnd.right - rcWnd.left;
719 info->szMin.cy = rcWnd.bottom - rcWnd.top;
720 }
721
722 if (lpBrowseInfo->lpszTitle)
724 else
726
727 if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT) || (lpBrowseInfo->ulFlags & BIF_USENEWUI))
729
730 // Hide "Make New Folder" Button?
731 if ((lpBrowseInfo->ulFlags & BIF_NONEWFOLDERBUTTON) ||
732 !(lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
733 {
735 }
736
737 // Hide the editbox?
738 if (!(lpBrowseInfo->ulFlags & BIF_EDITBOX))
739 {
742 }
743
745 if (info->hwndTreeView)
747 else
748 ERR("treeview control missing!\n");
749
750 // Register for change notifications
751 SHGetFolderLocation(NULL, CSIDL_DESKTOP, NULL, 0, &pidlDesktop);
752
753 ntreg.pidl = pidlDesktop;
754 ntreg.fRecursive = TRUE;
755 info->hChangeNotify = SHChangeNotifyRegister(hWnd,
758 SHV_CHANGE_NOTIFY, 1, &ntreg);
759
760 BrFolder_Callback(info->lpBrowseInfo, hWnd, BFFM_INITIALIZED, 0);
761
764 return TRUE;
765}
766
767static HRESULT
769{
770 CComPtr<IShellFolder> desktop, cur;
771 WCHAR wszNewFolder[25], path[MAX_PATH], name[MAX_PATH];
772
773 HRESULT hr = SHGetDesktopFolder(&desktop);
775 return hr;
776
777 if (info->pidlRet)
778 {
779 hr = desktop->BindToObject(info->pidlRet, NULL, IID_PPV_ARG(IShellFolder, &cur));
781 return hr;
782
783 hr = SHGetPathFromIDListW(info->pidlRet, path);
784 }
785 else
786 {
787 cur = desktop;
789 }
790
792 return hr;
793
794 hr = E_FAIL;
795 if (!LoadStringW(shell32_hInstance, IDS_NEWFOLDER, wszNewFolder, _countof(wszNewFolder)))
796 return hr;
797
798 if (!PathYetAnotherMakeUniqueName(name, path, NULL, wszNewFolder))
799 return hr;
800
801 INT len = lstrlenW(path);
802 if (len < MAX_PATH && name[len] == L'\\')
803 len++;
804
806 return hr;
807
808 // Update parent of newly created directory
809 HTREEITEM hParent = TreeView_GetSelection(info->hwndTreeView);
810 if (!hParent)
811 return hr;
812
813 TreeView_Expand(info->hwndTreeView, hParent, TVE_EXPAND);
814
816 item.hItem = hParent;
817 TreeView_GetItem(info->hwndTreeView, &item);
818 BrItemData *item_data = (BrItemData *)item.lParam;
819 if (!item_data)
820 return hr;
821
822 // Update treeview
823 if (!(item.state & TVIS_EXPANDEDONCE))
824 {
825 item.mask = TVIF_STATE;
826 item.state = item.stateMask = TVIS_EXPANDEDONCE;
827 TreeView_SetItem(info->hwndTreeView, &item);
828 }
829
831 hr = cur->ParseDisplayName(NULL, NULL, name + len, NULL, &pidlNew, NULL);
833 return hr;
834
835 HTREEITEM hAdded = BrFolder_InsertItem(info, cur, pidlNew, item_data->pidlFull, hParent);
836 TreeView_SortChildren(info->hwndTreeView, hParent, FALSE);
837 return BrFolder_Rename(info, hAdded);
838}
839
840static void
842{
843 // Get the text
846 StrTrimW(szPath, L" \t");
847
848 // The original pidl is owned by the treeview and will be free'd.
850 info->pidlRet = ILCreateFromPathW(szPath); // It's valid path
851 else
852 info->pidlRet = ILClone(info->pidlRet);
853
854 if (!info->pidlRet) // A null pidl would mean a cancel
855 info->pidlRet = _ILCreateDesktop();
856
857 pdump(info->pidlRet);
858
859 LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
860 if (!lpBrowseInfo->pszDisplayName)
861 return;
862
863 SHFILEINFOW fileInfo = { NULL };
864 lpBrowseInfo->pszDisplayName[0] = UNICODE_NULL;
865 if (SHGetFileInfoW((LPCWSTR)info->pidlRet, 0, &fileInfo, sizeof(fileInfo),
867 {
868 lstrcpynW(lpBrowseInfo->pszDisplayName, fileInfo.szDisplayName, MAX_PATH);
869 }
870}
871
872static void
874{
875 switch (id)
876 {
877 case IDOK:
878 {
880 EndDialog(info->hWnd, IDOK);
881 break;
882 }
883 case IDCANCEL:
884 {
885 EndDialog(info->hWnd, IDCANCEL);
886 break;
887 }
889 {
891 break;
892 }
893 }
894}
895
896static void
898{
899 RECT rc;
901 {
902 ppt->x = (rc.left + rc.right) / 2;
903 ppt->y = (rc.top + rc.bottom) / 2;
904 }
905 ClientToScreen(hWnd, ppt);
906}
907
908static void
910{
911 enum { IDC_TOGGLE = 1, ID_FIRSTCMD, ID_LASTCMD = 0xffff };
912 HTREEITEM hSelected = TreeView_GetSelection(info.hwndTreeView);
913 CMINVOKECOMMANDINFOEX ici = { sizeof(ici), CMIC_MASK_PTINVOKE, info.hWnd };
914 ici.nShow = SW_SHOW;
915 ici.ptInvoke.x = GET_X_LPARAM(lParam);
916 ici.ptInvoke.y = GET_Y_LPARAM(lParam);
917 if ((int)lParam == -1) // Keyboard
918 {
919 GetTreeViewItemContextMenuPos(info.hwndTreeView, hSelected, &ici.ptInvoke);
920 }
921 else // Get correct item for right-click on not current item
922 {
923 TVHITTESTINFO hti = { ici.ptInvoke };
924 ScreenToClient(info.hwndTreeView, &hti.pt);
925 hSelected = TreeView_HitTest(info.hwndTreeView, &hti);
926 }
928 if (!item)
929 return; // Not on an item
930
931 TV_ITEM tvi;
932 tvi.mask = TVIF_STATE | TVIF_CHILDREN;
933 tvi.stateMask = TVIS_EXPANDED;
934 tvi.hItem = hSelected;
935 TreeView_GetItem(info.hwndTreeView, &tvi);
936
938 HRESULT hr = item->lpsfParent->GetUIObjectOf(info.hWnd, 1, &item->pidlChild,
939 IID_IContextMenu, NULL, (void**)&pcm);
940 if (FAILED(hr))
941 return;
942
943 HMENU hMenu = CreatePopupMenu();
944 if (!hMenu)
945 return;
946 info.pContextMenu = pcm;
947 UINT cmf = ((GetKeyState(VK_SHIFT) < 0) ? CMF_EXTENDEDVERBS : 0) | CMF_CANRENAME;
948 hr = pcm->QueryContextMenu(hMenu, 0, ID_FIRSTCMD, ID_LASTCMD, CMF_NODEFAULT | cmf);
949 if (hr > 0)
950 _InsertMenuItemW(hMenu, 0, TRUE, 0, MFT_SEPARATOR, NULL, 0);
951 _InsertMenuItemW(hMenu, 0, TRUE, IDC_TOGGLE, MFT_STRING,
953 MFS_DEFAULT | (tvi.cChildren ? 0 : MFS_GRAYED));
954
955 UINT cmd = TrackPopupMenuEx(hMenu, TPM_RETURNCMD, ici.ptInvoke.x, ici.ptInvoke.y, info.hWnd, NULL);
956 ici.lpVerb = MAKEINTRESOURCEA(cmd - ID_FIRSTCMD);
957 if (cmd == IDC_TOGGLE)
958 {
959 TreeView_SelectItem(info.hwndTreeView, hSelected);
960 TreeView_Expand(info.hwndTreeView, hSelected, TVE_TOGGLE);
961 }
962 else if (cmd != 0 && GetDfmCmd(pcm, ici.lpVerb) == DFM_CMD_RENAME)
963 {
964 TreeView_SelectItem(info.hwndTreeView, hSelected);
965 TreeView_EditLabel(info.hwndTreeView, hSelected);
966 }
967 else if (cmd != 0)
968 {
969 if (GetKeyState(VK_SHIFT) < 0)
970 ici.fMask |= CMIC_MASK_SHIFT_DOWN;
971 if (GetKeyState(VK_CONTROL) < 0)
972 ici.fMask |= CMIC_MASK_CONTROL_DOWN;
973 pcm->InvokeCommand((CMINVOKECOMMANDINFO*)&ici);
974 }
975 info.pContextMenu = NULL;
976 DestroyMenu(hMenu);
977}
978
979static BOOL
981{
982 if (_ILIsDesktop(pidlSelection))
983 {
984 if (phItem)
985 *phItem = TVI_ROOT;
986 return TRUE;
987 }
988
989 // Move pidlCurrent behind the SHITEMIDs in pidlSelection, which are the root of
990 // the sub-tree currently displayed.
991 PCIDLIST_ABSOLUTE pidlRoot = info->lpBrowseInfo->pidlRoot;
992 LPITEMIDLIST pidlCurrent = pidlSelection;
993 while (!_ILIsEmpty(pidlRoot) && _ILIsEqualSimple(pidlRoot, pidlCurrent))
994 {
995 pidlRoot = ILGetNext(pidlRoot);
996 pidlCurrent = ILGetNext(pidlCurrent);
997 }
998
999 // The given ID List is not part of the SHBrowseForFolder's current sub-tree.
1000 if (!_ILIsEmpty(pidlRoot))
1001 {
1002 if (phItem)
1003 *phItem = NULL;
1004 return FALSE;
1005 }
1006
1007 // Initialize item to point to the first child of the root folder.
1009 item.hItem = TreeView_GetRoot(info->hwndTreeView);
1010 if (item.hItem)
1011 item.hItem = TreeView_GetChild(info->hwndTreeView, item.hItem);
1012
1013 // Walk the tree along the nodes corresponding to the remaining ITEMIDLIST
1014 while (item.hItem && !_ILIsEmpty(pidlCurrent))
1015 {
1016 TreeView_GetItem(info->hwndTreeView, &item);
1017 BrItemData *pItemData = (BrItemData *)item.lParam;
1018
1019 if (_ILIsEqualSimple(pItemData->pidlChild, pidlCurrent))
1020 {
1021 pidlCurrent = ILGetNext(pidlCurrent);
1022 if (!_ILIsEmpty(pidlCurrent))
1023 {
1024 // Only expand current node and move on to its first child,
1025 // if we didn't already reach the last SHITEMID
1026 TreeView_Expand(info->hwndTreeView, item.hItem, TVE_EXPAND);
1027 item.hItem = TreeView_GetChild(info->hwndTreeView, item.hItem);
1028 }
1029 }
1030 else
1031 {
1032 item.hItem = TreeView_GetNextSibling(info->hwndTreeView, item.hItem);
1033 }
1034 }
1035
1036 if (phItem)
1037 *phItem = item.hItem;
1038
1039 return (_ILIsEmpty(pidlCurrent) && item.hItem);
1040}
1041
1042static BOOL
1044{
1045 CComPtr<IShellFolder> psfDesktop;
1046 HRESULT hr = SHGetDesktopFolder(&psfDesktop);
1048 return FALSE;
1049
1051 hr = psfDesktop->ParseDisplayName(NULL, NULL, pszString, NULL, &pidlSelection, NULL);
1053 return FALSE;
1054
1055 return BrFolder_OnSetExpandedPidl(info, pidlSelection, phItem);
1056}
1057
1058static BOOL
1060{
1061 if (!pidlSelection)
1062 return FALSE;
1063
1065 BOOL ret = BrFolder_OnSetExpandedPidl(info, pidlSelection, &hItem);
1066 if (ret)
1067 TreeView_SelectItem(info->hwndTreeView, hItem);
1068 return ret;
1069}
1070
1071static BOOL
1073{
1074 if (!pszSelection)
1075 return FALSE;
1076
1078 BOOL ret = BrFolder_OnSetExpandedString(info, pszSelection, &hItem);
1079 if (ret)
1080 TreeView_SelectItem(info->hwndTreeView, hItem);
1081 return ret;
1082}
1083
1084static BOOL
1086{
1087 if (!pszSelectionA)
1088 return FALSE;
1089
1090 CComHeapPtr<WCHAR> pszSelectionW;
1091 __SHCloneStrAtoW(&pszSelectionW, pszSelectionA);
1092 if (!pszSelectionW)
1093 return FALSE;
1094
1095 return BrFolder_OnSetSelectionW(info, pszSelectionW);
1096}
1097
1098static void
1100{
1101 if (info->layout)
1102 {
1103 LayoutDestroy(info->layout);
1104 info->layout = NULL;
1105 }
1106
1107 SHChangeNotifyDeregister(info->hChangeNotify);
1108}
1109
1110static void
1113 _In_ HTREEITEM hTarget)
1114{
1115 // Get enum
1117 BrItemData *pItemData = BrFolder_GetItemData(info, hTarget);
1118 HRESULT hrEnum = BrFolder_GetChildrenEnum(info, pItemData, &pEnum);
1119
1120 // Insert new items
1121 if (SUCCEEDED(hrEnum))
1122 {
1124 while (S_OK == pEnum->Next(1, &pidlTemp, NULL))
1125 {
1126 if (!BrFolder_TreeItemHasThisChild(info, hTarget, pidlTemp))
1127 {
1128 BrFolder_InsertItem(info, pItemData->lpsfParent, pidlTemp, pItemData->pidlFull,
1129 hTarget);
1130 }
1131 pidlTemp.Free();
1132 }
1133 }
1134
1135 // Delete zombie items and update items
1136 HTREEITEM hItem, hNextItem;
1137 for (hItem = TreeView_GetChild(info->hwndTreeView, hTarget); hItem; hItem = hNextItem)
1138 {
1139 hNextItem = TreeView_GetNextSibling(info->hwndTreeView, hItem);
1140
1141 if (FAILED(hrEnum) || !BrFolder_IsTreeItemInEnum(info, hItem, pEnum))
1142 {
1143 TreeView_DeleteItem(info->hwndTreeView, hItem);
1144 hNextItem = TreeView_GetChild(info->hwndTreeView, hTarget);
1145 continue;
1146 }
1147
1150 }
1151
1152 if (SUCCEEDED(hrEnum))
1153 TreeView_SortChildren(info->hwndTreeView, hTarget, FALSE);
1154}
1155
1156static void
1158{
1159 HTREEITEM hRoot = TreeView_GetRoot(info->hwndTreeView);
1160
1161 SendMessageW(info->hwndTreeView, WM_SETREDRAW, FALSE, 0);
1162
1164
1165 SendMessageW(info->hwndTreeView, WM_SETREDRAW, TRUE, 0);
1166 InvalidateRect(info->hwndTreeView, NULL, TRUE);
1167}
1168
1169static void
1172 _In_ PCIDLIST_ABSOLUTE pidl0,
1173 _In_ PCIDLIST_ABSOLUTE pidl1,
1174 _In_ LONG event)
1175{
1176 TRACE("(%p)->(%p, %p, 0x%lX)\n", info, pidl0, pidl1, event);
1177
1178 switch (event)
1179 {
1180 case SHCNE_DRIVEADD:
1181 case SHCNE_MKDIR:
1182 case SHCNE_CREATE:
1183 case SHCNE_DRIVEREMOVED:
1184 case SHCNE_RMDIR:
1185 case SHCNE_DELETE:
1186 case SHCNE_RENAMEFOLDER:
1187 case SHCNE_RENAMEITEM:
1188 case SHCNE_UPDATEDIR:
1189 case SHCNE_UPDATEITEM:
1190 {
1191 // FIXME: Avoid full refresh and optimize for speed. Use pidl0 and pidl1
1193 break;
1194 }
1195 }
1196}
1197
1198// SHV_CHANGE_NOTIFY
1199static void
1201{
1202 // We use SHCNRF_NewDelivery method
1203 HANDLE hChange = (HANDLE)wParam;
1204 DWORD dwProcID = (DWORD)lParam;
1205
1206 PIDLIST_ABSOLUTE *ppidl = NULL;
1207 LONG event;
1208 HANDLE hLock = SHChangeNotification_Lock(hChange, dwProcID, &ppidl, &event);
1209 if (hLock == NULL)
1210 {
1211 ERR("hLock == NULL\n");
1212 return;
1213 }
1214
1215 BrFolder_OnChangeEx(info, ppidl[0], ppidl[1], (event & ~SHCNE_INTERRUPT));
1216
1218}
1219
1220/*************************************************************************
1221 * BrFolderDlgProc32 (not an exported API function)
1222 */
1223static INT_PTR CALLBACK
1225{
1226 if (uMsg == WM_INITDIALOG)
1228
1229 BrFolder *info = (BrFolder *)GetPropW(hWnd, L"__WINE_BRSFOLDERDLG_INFO");
1230 if (!info)
1231 return 0;
1232
1233 if (info->pContextMenu)
1234 {
1236 if (SHForwardContextMenuMsg(info->pContextMenu, uMsg, wParam,
1237 lParam, &result, TRUE) == S_OK)
1238 {
1240 return TRUE;
1241 }
1242 }
1243
1244 switch (uMsg)
1245 {
1246 case WM_NOTIFY:
1248 return TRUE;
1249
1250 case WM_COMMAND:
1252 break;
1253
1254 case WM_CONTEXTMENU:
1255 if (info->hwndTreeView == (HWND)wParam)
1257 break;
1258
1259 case WM_GETMINMAXINFO:
1260 ((LPMINMAXINFO)lParam)->ptMinTrackSize.x = info->szMin.cx;
1261 ((LPMINMAXINFO)lParam)->ptMinTrackSize.y = info->szMin.cy;
1262 break;
1263
1264 case WM_SIZE:
1265 if (info->layout) // New style dialogs
1267 break;
1268
1271 break;
1272
1275 break;
1276
1277 case BFFM_ENABLEOK:
1279 break;
1280
1281 case BFFM_SETOKTEXT: // Unicode only
1283 break;
1284
1285 case BFFM_SETSELECTIONA:
1286 if (wParam) // String
1288 else // PIDL
1290
1291 case BFFM_SETSELECTIONW:
1292 if (wParam) // String
1294 else // PIDL
1296
1297 case BFFM_SETEXPANDED: // Unicode only
1298 if (wParam) // String
1300 else // PIDL
1302
1303 case SHV_CHANGE_NOTIFY:
1305 break;
1306
1307 case WM_DESTROY:
1309 break;
1310 }
1311
1312 return 0;
1313}
1314
1315/*************************************************************************
1316 * SHBrowseForFolderA [SHELL32.@]
1317 * SHBrowseForFolder [SHELL32.@]
1318 */
1322{
1323 BROWSEINFOW bi;
1324 bi.hwndOwner = lpbi->hwndOwner;
1325 bi.pidlRoot = lpbi->pidlRoot;
1326
1328 bi.pszDisplayName = (lpbi->pszDisplayName ? szName : NULL);
1329
1330 CComHeapPtr<WCHAR> pszTitle;
1331 if (lpbi->lpszTitle)
1332 __SHCloneStrAtoW(&pszTitle, lpbi->lpszTitle);
1333 bi.lpszTitle = pszTitle;
1334
1335 bi.ulFlags = lpbi->ulFlags;
1336 bi.lpfn = lpbi->lpfn;
1337 bi.lParam = lpbi->lParam;
1338 bi.iImage = lpbi->iImage;
1340
1341 if (bi.pszDisplayName)
1343
1344 lpbi->iImage = bi.iImage;
1345 return pidl;
1346}
1347
1348/*************************************************************************
1349 * SHBrowseForFolderW [SHELL32.@]
1350 */
1354{
1355 TRACE("%p\n", lpbi);
1356
1357 BrFolder info = { lpbi };
1358
1360
1364 if (SUCCEEDED(hr))
1366
1367 if (ret != IDOK)
1368 {
1369 ILFree(info.pidlRet);
1370 return NULL;
1371 }
1372
1373 return info.pidlRet;
1374}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define shell32_hInstance
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define IDS_COLLAPSE
Definition: resource.h:191
#define IDS_EXPAND
Definition: resource.h:190
#define EXTERN_C
Definition: basetyps.h:12
#define FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
#define ERR(fmt,...)
Definition: debug.h:113
static HRESULT BrFolder_Rename(BrFolder *info, HTREEITEM hItem)
Definition: brfolder.cpp:564
static void BrFolder_OnContextMenu(BrFolder &info, LPARAM lParam)
Definition: brfolder.cpp:909
static void BrFolder_OnChange(BrFolder *info, WPARAM wParam, LPARAM lParam)
Definition: brfolder.cpp:1200
static BOOL BrFolder_OnSetSelectionPidl(BrFolder *info, LPITEMIDLIST pidlSelection)
Definition: brfolder.cpp:1059
static void GetTreeViewItemContextMenuPos(HWND hWnd, HTREEITEM hItem, POINT *ppt)
Definition: brfolder.cpp:897
EXTERN_C LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brfolder.cpp:1353
static HRESULT BrFolder_NewFolder(BrFolder *info)
Definition: brfolder.cpp:768
static void BrFolder_Callback(LPBROWSEINFOW lpBrowseInfo, HWND hWnd, UINT uMsg, LPARAM lParam)
Definition: brfolder.cpp:68
static void BrFolder_OnChangeEx(_Inout_ BrFolder *info, _In_ PCIDLIST_ABSOLUTE pidl0, _In_ PCIDLIST_ABSOLUTE pidl1, _In_ LONG event)
Definition: brfolder.cpp:1170
static BOOL BrFolder_OnSetSelectionW(BrFolder *info, LPWSTR pszSelection)
Definition: brfolder.cpp:1072
static INT_PTR CALLBACK BrFolderDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: brfolder.cpp:1224
static const LAYOUT_INFO g_layout_info[]
Definition: brfolder.cpp:38
static void BrFolder_Refresh(_Inout_ BrFolder *info)
Definition: brfolder.cpp:1157
#define SHV_CHANGE_NOTIFY
Definition: brfolder.cpp:17
static LRESULT BrFolder_Treeview_Expand(BrFolder *info, NMTREEVIEWW *pnmtv)
Definition: brfolder.cpp:476
static BOOL BrFolder_IsTreeItemInEnum(_Inout_ BrFolder *info, _In_ HTREEITEM hItem, _Inout_ IEnumIDList *pEnum)
Definition: brfolder.cpp:258
static BOOL PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type)
Definition: brfolder.cpp:419
#define SUPPORTED_FLAGS
Definition: brfolder.cpp:49
static SFGAOF BrFolder_GetItemAttributes(BrFolder *info, HTREEITEM hItem, SFGAOF Att)
Definition: brfolder.cpp:89
static BrItemData * BrFolder_GetItemData(BrFolder *info, HTREEITEM hItem)
Definition: brfolder.cpp:76
static void BrFolder_Delete(BrFolder *info, HTREEITEM hItem)
Definition: brfolder.cpp:572
static void BrFolder_RefreshRecurse(_Inout_ BrFolder *info, _In_ HTREEITEM hTarget)
Definition: brfolder.cpp:1111
static HRESULT BrFolder_GetChildrenEnum(_In_ BrFolder *info, _In_ BrItemData *pItemData, _Outptr_opt_ IEnumIDList **ppEnum)
Definition: brfolder.cpp:97
static HRESULT BrFolder_Treeview_Changed(BrFolder *info, NMTREEVIEWW *pnmtv)
Definition: brfolder.cpp:510
static void BrFolder_GetIconPair(PCIDLIST_ABSOLUTE pidl, LPTVITEMW pItem)
Definition: brfolder.cpp:206
static INT BrFolder_GetIcon(PCIDLIST_ABSOLUTE pidl, UINT uFlags)
Definition: brfolder.cpp:198
static DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
Definition: brfolder.cpp:62
static LRESULT BrFolder_Treeview_Keydown(BrFolder *info, LPNMTVKEYDOWN keydown)
Definition: brfolder.cpp:599
static HTREEITEM BrFolder_InsertItem(_Inout_ BrFolder *info, _Inout_ IShellFolder *lpsf, _In_ PCUITEMID_CHILD pidlChild, _In_ PCIDLIST_ABSOLUTE pidlParent, _In_ HTREEITEM hParent)
Definition: brfolder.cpp:339
static void BrFolder_OnOK(BrFolder *info)
Definition: brfolder.cpp:841
static LRESULT BrFolder_OnNotify(BrFolder *info, UINT CtlID, LPNMHDR lpnmh)
Definition: brfolder.cpp:631
static void BrFolder_UpdateItem(_In_ BrFolder *info, _In_ HTREEITEM hItem)
Definition: brfolder.cpp:299
static void BrFolder_InitTreeView(BrFolder *info)
Definition: brfolder.cpp:144
static void BrFolder_CheckValidSelection(BrFolder *info, BrItemData *pItemData)
Definition: brfolder.cpp:428
EXTERN_C LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi)
Definition: brfolder.cpp:1321
static BOOL BrFolder_OnSetSelectionA(BrFolder *info, LPSTR pszSelectionA)
Definition: brfolder.cpp:1085
static BOOL BrFolder_TreeItemHasThisChild(_In_ BrFolder *info, _In_ HTREEITEM hItem, _Outptr_opt_ PITEMID_CHILD pidlChild)
Definition: brfolder.cpp:282
static BOOL BrFolder_OnInitDialog(HWND hWnd, BrFolder *info)
Definition: brfolder.cpp:677
static BOOL BrFolder_OnSetExpandedString(BrFolder *info, LPWSTR pszString, HTREEITEM *phItem)
Definition: brfolder.cpp:1043
static void BrFolder_OnCommand(BrFolder *info, UINT id)
Definition: brfolder.cpp:873
static void BrFolder_Expand(_In_ BrFolder *info, _In_ IShellFolder *lpsf, _In_ PCIDLIST_ABSOLUTE pidlFull, _In_ HTREEITEM hParent)
Definition: brfolder.cpp:387
static BOOL BrFolder_OnSetExpandedPidl(BrFolder *info, LPITEMIDLIST pidlSelection, HTREEITEM *phItem)
Definition: brfolder.cpp:980
static LRESULT BrFolder_Treeview_Rename(BrFolder *info, NMTVDISPINFOW *pnmtv)
Definition: brfolder.cpp:527
static LRESULT BrFolder_Treeview_Delete(BrFolder *info, NMTREEVIEWW *pnmtv)
Definition: brfolder.cpp:465
static BOOL BrFolder_GetName(IShellFolder *lpsf, PCIDLIST_RELATIVE pidlChild, DWORD dwFlags, LPWSTR lpFriendlyName)
Definition: brfolder.cpp:240
static void BrFolder_OnDestroy(BrFolder *info)
Definition: brfolder.cpp:1099
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 BOOL WINAPI SHChangeNotification_Unlock(HANDLE hLock)
EXTERN_C BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
T * Detach()
Definition: atlcomcli.h:186
void Free()
Definition: atlalloc.h:153
void Attach(T *lp)
Definition: atlalloc.h:162
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_FAIL
Definition: ddrawi.h:102
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:311
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT uFlags
Definition: api.c:59
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
UINT GetDfmCmd(_In_ IContextMenu *pCM, _In_ LPCSTR verba)
Definition: utils.cpp:1376
HRESULT SHILAppend(_Inout_ LPITEMIDLIST pidl, _Inout_ LPITEMIDLIST *ppidl)
Definition: utils.cpp:73
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 SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2589
BOOL WINAPI PathYetAnotherMakeUniqueName(LPWSTR buffer, LPCWSTR path, LPCWSTR shortname, LPCWSTR longname)
Definition: shellpath.c:699
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1723
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1579
INT WINAPI SHUnicodeToAnsi(LPCWSTR lpSrcStr, LPSTR lpDstStr, INT iLen)
Definition: string.c:2791
BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim)
Definition: string.c:1877
static BOOLEAN bSuccess
Definition: drive.cpp:433
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
#define IDS_NEWFOLDER
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxCollectionEntry * cur
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
struct _cl_event * event
Definition: glext.h:7739
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:683
HRESULT BindToObject([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
HRESULT GetDisplayNameOf([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
HRESULT GetAttributesOf([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
static __inline LAYOUT_DATA * LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, INT cLayouts)
Definition: layout.h:206
static __inline void LayoutDestroy(LAYOUT_DATA *pData)
Definition: layout.h:251
static __inline void LayoutUpdate(HWND ignored1, LAYOUT_DATA *pData, LPCVOID ignored2, UINT ignored3)
Definition: layout.h:187
if(dx< 0)
Definition: linetemp.h:194
#define ASSERT(a)
Definition: mode.c:44
LPCWSTR szPath
Definition: env.c:37
static HTREEITEM hRoot
Definition: treeview.c:381
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
#define _Inout_
Definition: ms_sal.h:378
#define _Outptr_opt_
Definition: ms_sal.h:429
#define _In_
Definition: ms_sal.h:308
unsigned int UINT
Definition: ndis.h:50
#define DWORD
Definition: nt_native.h:44
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
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
LPITEMIDLIST _ILCreateDesktop(void)
Definition: pidl.c:1635
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2154
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:221
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1970
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1342
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:866
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:997
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:548
BYTE PIDLTYPE
Definition: pidl.h:108
static BOOL _ILIsEqualSimple(LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB)
Definition: pidl.h:249
#define PT_COMP
Definition: pidl.h:99
static BOOL _ILIsEmpty(LPCITEMIDLIST pidl)
Definition: pidl.h:255
static const WCHAR szName[]
Definition: powrprof.c:45
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TVN_KEYDOWN
Definition: commctrl.h:3713
#define TVIF_TEXT
Definition: commctrl.h:3266
#define TreeView_SelectItem(hwnd, hitem)
Definition: commctrl.h:3481
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3420
#define TreeView_GetChild(hwnd, hitem)
Definition: commctrl.h:3466
#define TVN_ITEMEXPANDINGA
Definition: commctrl.h:3699
#define TreeView_SortChildren(hwnd, hitem, recurse)
Definition: commctrl.h:3542
#define NMTVDISPINFO
Definition: commctrl.h:3675
#define TVN_BEGINLABELEDITA
Definition: commctrl.h:3709
#define TVIF_IMAGE
Definition: commctrl.h:3267
#define TVIS_EXPANDEDONCE
Definition: commctrl.h:3285
#define TVN_SELCHANGEDW
Definition: commctrl.h:3648
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3473
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3490
#define TreeView_GetItemRect(hwnd, hitem, prc, code)
Definition: commctrl.h:3429
#define TVE_EXPAND
Definition: commctrl.h:3423
#define TVI_ROOT
Definition: commctrl.h:3368
#define TVE_TOGGLE
Definition: commctrl.h:3424
#define TV_ITEM
Definition: commctrl.h:3300
#define TreeView_GetRoot(hwnd)
Definition: commctrl.h:3475
#define TVN_DELETEITEMA
Definition: commctrl.h:3707
#define TVIF_HANDLE
Definition: commctrl.h:3270
#define TreeView_GetNextSibling(hwnd, hitem)
Definition: commctrl.h:3467
#define TVIS_EXPANDED
Definition: commctrl.h:3284
#define TVN_ITEMEXPANDINGW
Definition: commctrl.h:3700
#define TVN_BEGINLABELEDITW
Definition: commctrl.h:3710
#define TreeView_EditLabel(hwnd, hitem)
Definition: commctrl.h:3504
#define TVIF_PARAM
Definition: commctrl.h:3268
#define TVN_SELCHANGEDA
Definition: commctrl.h:3647
#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 TVN_DELETEITEMW
Definition: commctrl.h:3708
#define TVIF_STATE
Definition: commctrl.h:3269
#define TreeView_DeleteItem(hwnd, hitem)
Definition: commctrl.h:3415
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
HRESULT WINAPI SHForwardContextMenuMsg(IUnknown *pUnk, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult, BOOL useIContextMenu2)
Definition: rosordinal.c:11
const WCHAR * str
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:415
static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source)
Definition: shell32_main.h:170
#define SHGFI_OPENICON
Definition: shellapi.h:178
#define SHGFI_SYSICONINDEX
Definition: shellapi.h:171
#define SHGFI_DISPLAYNAME
Definition: shellapi.h:166
#define FOF_ALLOWUNDO
Definition: shellapi.h:147
#define FO_DELETE
Definition: shellapi.h:138
#define SHGFI_SMALLICON
Definition: shellapi.h:176
#define SHGFI_PIDL
Definition: shellapi.h:180
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
Definition: shlfileop.cpp:1987
HRESULT hr
Definition: shlfolder.c:183
#define BIF_STATUSTEXT
Definition: shlobj.h:1219
#define SHCNE_DRIVEREMOVED
Definition: shlobj.h:1890
#define BFFM_SETOKTEXT
Definition: shlobj.h:1248
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2181
#define BFFM_SELCHANGED
Definition: shlobj.h:1237
#define SHCNE_RMDIR
Definition: shlobj.h:1887
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1217
#define SHCNE_DELETE
Definition: shlobj.h:1885
#define SHCNE_MKDIR
Definition: shlobj.h:1886
@ SHGFP_TYPE_CURRENT
Definition: shlobj.h:2142
#define BIF_RETURNFSANCESTORS
Definition: shlobj.h:1220
#define SHCNE_UPDATEITEM
Definition: shlobj.h:1896
#define BFFM_SETEXPANDED
Definition: shlobj.h:1249
#define SHCNE_RENAMEITEM
Definition: shlobj.h:1883
#define SHCNE_UPDATEDIR
Definition: shlobj.h:1895
#define BFFM_ENABLEOK
Definition: shlobj.h:1244
#define SHCNE_CREATE
Definition: shlobj.h:1884
#define SHCNE_RENAMEFOLDER
Definition: shlobj.h:1900
#define BIF_USENEWUI
Definition: shlobj.h:1224
#define SHCNRF_NewDelivery
Definition: shlobj.h:1931
#define SHCNRF_ShellLevel
Definition: shlobj.h:1929
#define BFFM_SETSELECTIONW
Definition: shlobj.h:1246
#define BIF_BROWSEINCLUDEFILES
Definition: shlobj.h:1232
#define SHCNE_DRIVEADD
Definition: shlobj.h:1891
#define BFFM_SETSTATUSTEXTW
Definition: shlobj.h:1247
#define CSIDL_DESKTOP
Definition: shlobj.h:2166
#define BFFM_INITIALIZED
Definition: shlobj.h:1236
#define SHCNE_ALLEVENTS
Definition: shlobj.h:1907
#define BFFM_SETSTATUSTEXTA
Definition: shlobj.h:1243
#define BIF_NONEWFOLDERBUTTON
Definition: shlobj.h:1227
#define DFM_CMD_RENAME
Definition: shlobj.h:2613
#define BIF_NEWDIALOGSTYLE
Definition: shlobj.h:1223
#define SHCNE_INTERRUPT
Definition: shlobj.h:1908
#define BIF_EDITBOX
Definition: shlobj.h:1221
#define BIF_BROWSEFORCOMPUTER
Definition: shlobj.h:1230
#define BFFM_SETSELECTIONA
Definition: shlobj.h:1245
HRESULT WINAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags)
Definition: autocomp.cpp:191
#define SHACF_FILESYSTEM
Definition: shlwapi.h:1912
#define SHACF_URLHISTORY
Definition: shlwapi.h:1913
#define SHACF_FILESYS_ONLY
Definition: shlwapi.h:1917
#define IDD_BROWSE_FOR_FOLDER_NEW
Definition: shresdef.h:437
#define IDC_BROWSE_FOR_FOLDER_FOLDER_TEXT
Definition: shresdef.h:439
#define IDC_BROWSE_FOR_FOLDER_TREEVIEW
Definition: shresdef.h:443
#define IDC_BROWSE_FOR_FOLDER_NEW_FOLDER
Definition: shresdef.h:438
#define IDD_BROWSE_FOR_FOLDER
Definition: shresdef.h:436
#define IDC_BROWSE_FOR_FOLDER_STATUS
Definition: shresdef.h:441
#define IDC_BROWSE_FOR_FOLDER_TITLE
Definition: shresdef.h:442
#define IDC_BROWSE_FOR_FOLDER_FOLDER
Definition: shresdef.h:440
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
ULONG hChangeNotify
Definition: brfolder.cpp:27
IContextMenu * pContextMenu
Definition: brfolder.cpp:28
HWND hWnd
Definition: brfolder.cpp:22
LPBROWSEINFOW lpBrowseInfo
Definition: brfolder.cpp:21
LAYOUT_DATA * layout
Definition: brfolder.cpp:25
PIDLIST_ABSOLUTE pidlRet
Definition: brfolder.cpp:24
SIZE szMin
Definition: brfolder.cpp:26
HWND hwndTreeView
Definition: brfolder.cpp:23
PCIDLIST_RELATIVE pidlChild
Definition: brfolder.cpp:34
CComHeapPtr< ITEMIDLIST_ABSOLUTE > pidlFull
Definition: brfolder.cpp:35
CComPtr< IShellFolder > lpsfParent
Definition: brfolder.cpp:33
PCIDLIST_ABSOLUTE pidl
Definition: shlobj.h:1879
WCHAR szDisplayName[MAX_PATH]
Definition: shellapi.h:375
LPCWSTR pFrom
Definition: shellapi.h:357
FILEOP_FLAGS fFlags
Definition: shellapi.h:359
Definition: ftp_var.h:139
Definition: name.c:39
LPCSTR lpszTitle
Definition: shlobj.h:1192
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1190
BFFCALLBACK lpfn
Definition: shlobj.h:1194
HWND hwndOwner
Definition: shlobj.h:1189
LPSTR pszDisplayName
Definition: shlobj.h:1191
UINT ulFlags
Definition: shlobj.h:1193
LPARAM lParam
Definition: shlobj.h:1195
BFFCALLBACK lpfn
Definition: shlobj.h:1205
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1201
UINT ulFlags
Definition: shlobj.h:1204
LPWSTR pszDisplayName
Definition: shlobj.h:1202
HWND hwndOwner
Definition: shlobj.h:1200
LPCWSTR lpszTitle
Definition: shlobj.h:1203
LPARAM lParam
Definition: shlobj.h:1206
UINT_PTR idFrom
Definition: winuser.h:3158
UINT code
Definition: winuser.h:3159
TVITEMW itemNew
Definition: commctrl.h:3638
TVITEMW itemOld
Definition: commctrl.h:3637
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
TVITEMW item
Definition: commctrl.h:3672
HTREEITEM hItem
Definition: commctrl.h:3317
LPARAM lParam
Definition: commctrl.h:3325
LPWSTR pszText
Definition: commctrl.h:3320
int iImage
Definition: commctrl.h:3322
UINT state
Definition: commctrl.h:3318
int iSelectedImage
Definition: commctrl.h:3323
#define SetWindowLongPtr
Definition: treelist.c:70
HTREEITEM hItem
Definition: treelist.h:37
int32_t INT_PTR
Definition: typedefs.h:64
PVOID HANDLE
Definition: typedefs.h:73
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
DWORD dwAttributes
Definition: vdmdbg.h:34
int ret
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
HWND WINAPI SetCapture(_In_ HWND hWnd)
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define SW_HIDE
Definition: winuser.h:768
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define IDCANCEL
Definition: winuser.h:831
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define WM_SIZE
Definition: winuser.h:1611
#define WM_COMMAND
Definition: winuser.h:1740
#define BF_LEFT
Definition: winuser.h:454
#define IDC_ARROW
Definition: winuser.h:687
#define VK_CONTROL
Definition: winuser.h:2203
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define BF_BOTTOM
Definition: winuser.h:457
#define WM_INITDIALOG
Definition: winuser.h:1739
#define MFT_SEPARATOR
Definition: winuser.h:744
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2136
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
#define MFS_DEFAULT
Definition: winuser.h:748
#define WM_GETMINMAXINFO
Definition: winuser.h:1640
#define VK_F5
Definition: winuser.h:2259
#define MFS_GRAYED
Definition: winuser.h:751
#define BF_TOP
Definition: winuser.h:455
#define BF_RIGHT
Definition: winuser.h:456
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL WINAPI SetDlgItemTextA(_In_ HWND, _In_ int, _In_ LPCSTR)
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define DWLP_MSGRESULT
Definition: winuser.h:870
#define IDC_WAIT
Definition: winuser.h:689
struct tagMINMAXINFO * LPMINMAXINFO
#define VK_SHIFT
Definition: winuser.h:2202
#define MFT_STRING
Definition: winuser.h:746
#define SW_SHOW
Definition: winuser.h:775
#define VK_DELETE
Definition: winuser.h:2233
#define WM_DESTROY
Definition: winuser.h:1609
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define TPM_RETURNCMD
Definition: winuser.h:2387
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
SHORT WINAPI GetKeyState(_In_ int)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define WM_SETREDRAW
Definition: winuser.h:1616
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define VK_F2
Definition: winuser.h:2256
#define IID_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