ReactOS  0.4.15-dev-488-gc7a1924
brsfolder.c
Go to the documentation of this file.
1 /*
2  * Copyright 1999 Juergen Schmied
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  *
18  * FIXME:
19  * - many memory leaks
20  * - many flags unimplemented
21  * - implement editbox
22  */
23 
24 #define WIN32_NO_STATUS
25 #define _INC_WINDOWS
26 #define COBJMACROS
27 #define NONAMELESSUNION
28 #define NONAMELESSSTRUCT
29 
30 #include <windef.h>
31 #include <winbase.h>
32 #include <shlobj.h>
33 #include <undocshell.h>
34 #include <shellapi.h>
35 #include <wine/debug.h>
36 #include <wine/unicode.h>
37 
38 #include "pidl.h"
39 #include "shell32_main.h"
40 #include "shresdef.h"
41 
43 
44 #define SHV_CHANGE_NOTIFY (WM_USER + 0x1111)
45 
46 /* original margins and control size */
47 typedef struct tagLAYOUT_DATA
48 {
51 } LAYOUT_DATA;
52 
53 typedef struct tagbrowse_info
54 {
59  LAYOUT_DATA *layout; /* filled by LayoutInit, used by LayoutUpdate */
61  ULONG hNotify; /* change notification handle */
62 } browse_info;
63 
64 typedef struct tagTV_ITEMDATA
65 {
66  LPSHELLFOLDER lpsfParent; /* IShellFolder of the parent */
67  LPITEMIDLIST lpi; /* PIDL relative to parent */
68  LPITEMIDLIST lpifq; /* Fully qualified PIDL */
69  IEnumIDList* pEnumIL; /* Children iterator */
71 
72 typedef struct tagLAYOUT_INFO
73 {
74  int iItemId; /* control id */
75  DWORD dwAnchor; /* BF_* flags specifying which margins should remain constant */
76 } LAYOUT_INFO;
77 
78 static const LAYOUT_INFO g_layout_info[] =
79 {
89 };
90 
91 #define LAYOUT_INFO_COUNT (sizeof(g_layout_info)/sizeof(g_layout_info[0]))
92 
93 #define SUPPORTEDFLAGS (BIF_STATUSTEXT | \
94  BIF_BROWSEFORCOMPUTER | \
95  BIF_RETURNFSANCESTORS | \
96  BIF_RETURNONLYFSDIRS | \
97  BIF_NONEWFOLDERBUTTON | \
98  BIF_NEWDIALOGSTYLE | \
99  BIF_BROWSEINCLUDEFILES)
100 
101 static void FillTreeView(browse_info*, LPSHELLFOLDER,
105 
106 static const WCHAR szBrowseFolderInfo[] = {
107  '_','_','W','I','N','E','_',
108  'B','R','S','F','O','L','D','E','R','D','L','G','_',
109  'I','N','F','O',0
110 };
111 
112 static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
113 {
114  return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0);
115 }
116 
117 static void browsefolder_callback( LPBROWSEINFOW lpBrowseInfo, HWND hWnd,
118  UINT msg, LPARAM param )
119 {
120  if (!lpBrowseInfo->lpfn)
121  return;
122  lpBrowseInfo->lpfn( hWnd, msg, param, lpBrowseInfo->lParam );
123 }
124 
125 static LAYOUT_DATA *LayoutInit(HWND hwnd, const LAYOUT_INFO *layout_info, int layout_count)
126 {
127  LAYOUT_DATA *data;
128  RECT rcWnd;
129  int i;
130 
131  GetClientRect(hwnd, &rcWnd);
132  data = SHAlloc(sizeof(LAYOUT_DATA)*layout_count);
133  for (i = 0; i < layout_count; i++)
134  {
135  RECT r;
136  HWND hItem = GetDlgItem(hwnd, layout_info[i].iItemId);
137 
138  if (hItem == NULL)
139  ERR("Item %d not found\n", i);
140  GetWindowRect(hItem, &r);
142 
143  data[i].left = r.left;
144  data[i].right = rcWnd.right - r.right;
145  data[i].width = r.right - r.left;
146 
147  data[i].top = r.top;
148  data[i].bottom = rcWnd.bottom - r.bottom;
149  data[i].height = r.bottom - r.top;
150  }
151  return data;
152 }
153 
154 static void LayoutUpdate(HWND hwnd, LAYOUT_DATA *data, const LAYOUT_INFO *layout_info, int layout_count)
155 {
156  RECT rcWnd;
157  int i;
158 
159  GetClientRect(hwnd, &rcWnd);
160  for (i = 0; i < layout_count; i++)
161  {
162  RECT r;
163  HWND hItem = GetDlgItem(hwnd, layout_info[i].iItemId);
164 
165  GetWindowRect(hItem, &r);
167 
168  if (layout_info[i].dwAnchor & BF_RIGHT)
169  {
170  r.right = rcWnd.right - data[i].right;
171  if (!(layout_info[i].dwAnchor & BF_LEFT))
172  r.left = r.right - data[i].width;
173  }
174 
175  if (layout_info[i].dwAnchor & BF_BOTTOM)
176  {
177  r.bottom = rcWnd.bottom - data[i].bottom;
178  if (!(layout_info[i].dwAnchor & BF_TOP))
179  r.top = r.bottom - data[i].height;
180  }
181 
182  SetWindowPos(hItem, NULL, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOZORDER);
183  }
184 }
185 
186 
187 /******************************************************************************
188  * InitializeTreeView [Internal]
189  *
190  * Called from WM_INITDIALOG handler.
191  *
192  * PARAMS
193  * hwndParent [I] The BrowseForFolder dialog
194  * root [I] ITEMIDLIST of the root shell folder
195  */
197 {
198  LPITEMIDLIST pidlParent, pidlChild;
199  HIMAGELIST hImageList;
200  HRESULT hr;
201  IShellFolder *lpsfParent, *lpsfRoot;
202  IEnumIDList * pEnumChildren = NULL;
203  HTREEITEM item;
204  DWORD flags;
205  LPCITEMIDLIST root = info->lpBrowseInfo->pidlRoot;
206 
207  TRACE("%p\n", info );
208 
209  Shell_GetImageLists(NULL, &hImageList);
210 
211  if (hImageList)
212  SendMessageW( info->hwndTreeView, TVM_SETIMAGELIST, 0, (LPARAM)hImageList );
213 
214  /* We want to call InsertTreeViewItem down the code, in order to insert
215  * the root item of the treeview. Due to InsertTreeViewItem's signature,
216  * we need the following to do this:
217  *
218  * + An ITEMIDLIST corresponding to _the parent_ of root.
219  * + An ITEMIDLIST, which is a relative path from root's parent to root
220  * (containing a single SHITEMID).
221  * + An IShellFolder interface pointer of root's parent folder.
222  *
223  * If root is 'Desktop', then root's parent is also 'Desktop'.
224  */
225 
226  pidlParent = ILClone(root);
227  ILRemoveLastID(pidlParent);
228  pidlChild = ILClone(ILFindLastID(root));
229 
230  if (_ILIsDesktop(pidlParent)) {
231  hr = SHGetDesktopFolder(&lpsfParent);
232  } else {
233  IShellFolder *lpsfDesktop;
234  hr = SHGetDesktopFolder(&lpsfDesktop);
235  if (FAILED(hr)) {
236  WARN("SHGetDesktopFolder failed! hr = %08x\n", hr);
237  ILFree(pidlChild);
238  ILFree(pidlParent);
239  return;
240  }
241  hr = IShellFolder_BindToObject(lpsfDesktop, pidlParent, 0, &IID_IShellFolder, (LPVOID*)&lpsfParent);
242  IShellFolder_Release(lpsfDesktop);
243  }
244 
245  if (FAILED(hr)) {
246  WARN("Could not bind to parent shell folder! hr = %08x\n", hr);
247  ILFree(pidlChild);
248  ILFree(pidlParent);
249  return;
250  }
251 
252  if (!_ILIsEmpty(pidlChild)) {
253  hr = IShellFolder_BindToObject(lpsfParent, pidlChild, 0, &IID_IShellFolder, (LPVOID*)&lpsfRoot);
254  } else {
255  lpsfRoot = lpsfParent;
256  hr = IShellFolder_AddRef(lpsfParent);
257  }
258 
259  if (FAILED(hr)) {
260  WARN("Could not bind to root shell folder! hr = %08x\n", hr);
261  IShellFolder_Release(lpsfParent);
262  ILFree(pidlChild);
263  ILFree(pidlParent);
264  return;
265  }
266 
267  flags = BrowseFlagsToSHCONTF( info->lpBrowseInfo->ulFlags );
268  hr = IShellFolder_EnumObjects( lpsfRoot, info->hWnd, flags, &pEnumChildren );
269  if (FAILED(hr)) {
270  WARN("Could not get child iterator! hr = %08x\n", hr);
271  IShellFolder_Release(lpsfParent);
272  IShellFolder_Release(lpsfRoot);
273  ILFree(pidlChild);
274  ILFree(pidlParent);
275  return;
276  }
277 
278  SendMessageW( info->hwndTreeView, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT );
279  item = InsertTreeViewItem( info, lpsfParent, pidlChild,
280  pidlParent, pEnumChildren, TVI_ROOT );
281  SendMessageW( info->hwndTreeView, TVM_EXPAND, TVE_EXPAND, (LPARAM)item );
282 
283  ILFree(pidlChild);
284  ILFree(pidlParent);
285  IShellFolder_Release(lpsfRoot);
286  IShellFolder_Release(lpsfParent);
287 }
288 
290 {
291  SHFILEINFOW sfi;
292  SHGetFileInfoW((LPCWSTR)lpi, 0 ,&sfi, sizeof(SHFILEINFOW), uFlags);
293  return sfi.iIcon;
294 }
295 
296 static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM)
297 {
298  LPITEMIDLIST pidlDesktop = NULL;
299  DWORD flags;
300 
301  TRACE("%p %p\n",lpifq, lpTV_ITEM);
302 
303  if (!lpifq)
304  {
305  pidlDesktop = _ILCreateDesktop();
306  lpifq = pidlDesktop;
307  }
308 
310  lpTV_ITEM->iImage = GetIcon( lpifq, flags );
311 
313  lpTV_ITEM->iSelectedImage = GetIcon( lpifq, flags );
314 
315  if (pidlDesktop)
316  ILFree( pidlDesktop );
317 }
318 
319 /******************************************************************************
320  * GetName [Internal]
321  *
322  * Query a shell folder for the display name of one of its children
323  *
324  * PARAMS
325  * lpsf [I] IShellFolder interface of the folder to be queried.
326  * lpi [I] ITEMIDLIST of the child, relative to parent
327  * dwFlags [I] as in IShellFolder::GetDisplayNameOf
328  * lpFriendlyName [O] The desired display name in unicode
329  *
330  * RETURNS
331  * Success: TRUE
332  * Failure: FALSE
333  */
334 static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName)
335 {
337  STRRET str;
338 
339  TRACE("%p %p %x %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
340  if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str)))
341  bSuccess = StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi);
342  else
343  bSuccess = FALSE;
344 
345  TRACE("-- %s\n", debugstr_w(lpFriendlyName));
346  return bSuccess;
347 }
348 
349 /******************************************************************************
350  * InsertTreeViewItem [Internal]
351  *
352  * PARAMS
353  * info [I] data for the dialog
354  * lpsf [I] IShellFolder interface of the item's parent shell folder
355  * pidl [I] ITEMIDLIST of the child to insert, relative to parent
356  * pidlParent [I] ITEMIDLIST of the parent shell folder
357  * pEnumIL [I] Iterator for the children of the item to be inserted
358  * hParent [I] The treeview-item that represents the parent shell folder
359  *
360  * RETURNS
361  * Success: Handle to the created and inserted treeview-item
362  * Failure: NULL
363  */
365  LPCITEMIDLIST pidl, LPCITEMIDLIST pidlParent, IEnumIDList* pEnumIL,
367 {
368  TVITEMW tvi;
369  TVINSERTSTRUCTW tvins;
370  WCHAR szBuff[MAX_PATH];
371  LPTV_ITEMDATA lptvid=0;
372 
374 
375  tvi.cChildren= pEnumIL ? 1 : 0;
376  tvi.mask |= TVIF_CHILDREN;
377 
378  if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
379  return NULL;
380 
381  lptvid = SHAlloc( sizeof(TV_ITEMDATA) );
382  if (!lptvid)
383  return NULL;
384 
385  tvi.pszText = szBuff;
386  tvi.cchTextMax = MAX_PATH;
387  tvi.lParam = (LPARAM)lptvid;
388 
389  IShellFolder_AddRef(lpsf);
390  lptvid->lpsfParent = lpsf;
391  lptvid->lpi = ILClone(pidl);
392  lptvid->lpifq = pidlParent ? ILCombine(pidlParent, pidl) : ILClone(pidl);
393  lptvid->pEnumIL = pEnumIL;
394  GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
395 
396  tvins.u.item = tvi;
397  tvins.hInsertAfter = NULL;
398  tvins.hParent = hParent;
399 
400  return TreeView_InsertItem( info->hwndTreeView, &tvins );
401 }
402 
403 /******************************************************************************
404  * FillTreeView [Internal]
405  *
406  * For each child (given by lpe) of the parent shell folder, which is given by
407  * lpsf and whose PIDL is pidl, insert a treeview-item right under hParent
408  *
409  * PARAMS
410  * info [I] data for the dialog
411  * lpsf [I] IShellFolder interface of the parent shell folder
412  * pidl [I] ITEMIDLIST of the parent shell folder
413  * hParent [I] The treeview item that represents the parent shell folder
414  * lpe [I] An iterator for the children of the parent shell folder
415  */
418 {
419  LPITEMIDLIST pidlTemp = 0;
420  ULONG ulFetched;
421  HRESULT hr;
422  HWND hwnd = GetParent( info->hwndTreeView );
423 
424  TRACE("%p %p %p %p\n",lpsf, pidl, hParent, lpe);
425 
426  /* No IEnumIDList -> No children */
427  if (!lpe) return;
428 
429  SetCapture( hwnd );
431 
432  while (S_OK == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched))
433  {
434  ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
435  IEnumIDList* pEnumIL = NULL;
436  IShellFolder* pSFChild = NULL;
437  IShellFolder_GetAttributesOf(lpsf, 1, (LPCITEMIDLIST*)&pidlTemp, &ulAttrs);
438  if (ulAttrs & SFGAO_FOLDER)
439  {
440  hr = IShellFolder_BindToObject(lpsf,pidlTemp,NULL,&IID_IShellFolder,(LPVOID*)&pSFChild);
441  if (SUCCEEDED(hr))
442  {
443  DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
444  hr = IShellFolder_EnumObjects(pSFChild, hwnd, flags, &pEnumIL);
445  if (hr == S_OK)
446  {
447  if ((IEnumIDList_Skip(pEnumIL, 1) != S_OK) ||
448  FAILED(IEnumIDList_Reset(pEnumIL)))
449  {
450  IEnumIDList_Release(pEnumIL);
451  pEnumIL = NULL;
452  }
453  }
454  IShellFolder_Release(pSFChild);
455  }
456  }
457 
458  if (!InsertTreeViewItem(info, lpsf, pidlTemp, pidl, pEnumIL, hParent))
459  goto done;
460  SHFree(pidlTemp); /* Finally, free the pidl that the shell gave us... */
461  pidlTemp=NULL;
462  }
463 
464 done:
465  ReleaseCapture();
467  SHFree(pidlTemp);
468 }
469 
471 {
473  if (!data)
474  return FALSE;
475  return (data->type == type);
476 }
477 
479 {
480  LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
481  LPCITEMIDLIST pidl = lptvid->lpi;
482  BOOL bEnabled = TRUE;
484  HRESULT r;
485 
486  if ((lpBrowseInfo->ulFlags & BIF_BROWSEFORCOMPUTER) &&
487  !PIDLIsType(pidl, PT_COMP))
488  bEnabled = FALSE;
489  if (lpBrowseInfo->ulFlags & BIF_RETURNFSANCESTORS)
490  {
491  dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM;
492  r = IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1,
493  (LPCITEMIDLIST*)&lptvid->lpi, &dwAttributes);
494  if (FAILED(r) || !(dwAttributes & (SFGAO_FILESYSANCESTOR|SFGAO_FILESYSTEM)))
495  bEnabled = FALSE;
496  }
497 
498  dwAttributes = SFGAO_FOLDER | SFGAO_FILESYSTEM;
499  r = IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1,
500  (LPCITEMIDLIST*)&lptvid->lpi, &dwAttributes);
501  if (FAILED(r) ||
502  ((dwAttributes & (SFGAO_FOLDER|SFGAO_FILESYSTEM)) != (SFGAO_FOLDER|SFGAO_FILESYSTEM)))
503  {
504  if (lpBrowseInfo->ulFlags & BIF_RETURNONLYFSDIRS)
505  bEnabled = FALSE;
507  }
508  else
510 
511  SendMessageW(info->hWnd, BFFM_ENABLEOK, 0, bEnabled);
512 }
513 
515 {
516  LPTV_ITEMDATA lptvid = (LPTV_ITEMDATA)pnmtv->itemOld.lParam;
517 
518  TRACE("TVN_DELETEITEMA/W %p\n", lptvid);
519 
520  IShellFolder_Release(lptvid->lpsfParent);
521  if (lptvid->pEnumIL)
522  IEnumIDList_Release(lptvid->pEnumIL);
523  SHFree(lptvid->lpi);
524  SHFree(lptvid->lpifq);
525  SHFree(lptvid);
526  return 0;
527 }
528 
530 {
531  IShellFolder *lpsf2 = NULL;
532  LPTV_ITEMDATA lptvid = (LPTV_ITEMDATA) pnmtv->itemNew.lParam;
533  HRESULT r;
534 
535  TRACE("TVN_ITEMEXPANDINGA/W\n");
536 
537  if ((pnmtv->itemNew.state & TVIS_EXPANDEDONCE))
538  return 0;
539 
540  if (!_ILIsEmpty(lptvid->lpi)) {
541  r = IShellFolder_BindToObject( lptvid->lpsfParent, lptvid->lpi, 0,
542  &IID_IShellFolder, (void**)&lpsf2 );
543  } else {
544  lpsf2 = lptvid->lpsfParent;
545  IShellFolder_AddRef(lpsf2);
546  r = S_OK;
547  }
548 
549  if (SUCCEEDED(r))
550  {
551  FillTreeView( info, lpsf2, lptvid->lpifq, pnmtv->itemNew.hItem, lptvid->pEnumIL);
552  IShellFolder_Release( lpsf2 );
553  }
554 
555  /* My Computer is already sorted and trying to do a simple text
556  * sort will only mess things up */
557  if (!_ILIsMyComputer(lptvid->lpi))
558  SendMessageW( info->hwndTreeView, TVM_SORTCHILDREN,
559  FALSE, (LPARAM)pnmtv->itemNew.hItem );
560 
561  return 0;
562 }
563 
565 {
566  LPTV_ITEMDATA lptvid = (LPTV_ITEMDATA) pnmtv->itemNew.lParam;
568 
569  ILFree(info->pidlRet);
570  info->pidlRet = ILClone(lptvid->lpifq);
571 
572  if (GetName(lptvid->lpsfParent, lptvid->lpi, SHGDN_NORMAL, name))
574 
575  browsefolder_callback( info->lpBrowseInfo, info->hWnd, BFFM_SELCHANGED,
576  (LPARAM)info->pidlRet );
578  return S_OK;
579 }
580 
582 {
583  LPTV_ITEMDATA item_data;
584  WCHAR old_path[MAX_PATH], new_path[MAX_PATH], *p;
585  NMTREEVIEWW nmtv;
586  TVITEMW item;
587 
588  if(!pnmtv->item.pszText)
589  return 0;
590 
591  item.mask = TVIF_HANDLE|TVIF_PARAM;
592  item.hItem = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_CARET, 0);
593  SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item);
594  item_data = (LPTV_ITEMDATA)item.lParam;
595 
596  SHGetPathFromIDListW(item_data->lpifq, old_path);
597  if(!(p = strrchrW(old_path, '\\')))
598  return 0;
599  p = new_path+(p-old_path+1);
600  memcpy(new_path, old_path, (p-new_path)*sizeof(WCHAR));
601  strcpyW(p, pnmtv->item.pszText);
602 
603  if(!MoveFileW(old_path, new_path))
604  return 0;
605 
606  SHFree(item_data->lpifq);
607  SHFree(item_data->lpi);
608  item_data->lpifq = SHSimpleIDListFromPathW(new_path);
609  IShellFolder_ParseDisplayName(item_data->lpsfParent, NULL, NULL,
610  pnmtv->item.pszText, NULL, &item_data->lpi, NULL);
611 
612  item.mask = TVIF_HANDLE|TVIF_TEXT;
613  item.pszText = pnmtv->item.pszText;
614  SendMessageW(info->hwndTreeView, TVM_SETITEMW, 0, (LPARAM)&item);
615 
616  nmtv.itemNew.lParam = item.lParam;
618  return 0;
619 }
620 
622 {
624  SendMessageW(info->hwndTreeView, TVM_EDITLABELW, 0, (LPARAM)rename);
625  return S_OK;
626 }
627 
628 #ifdef __REACTOS__
629 static void
630 BrsFolder_Delete(browse_info *info, HTREEITEM selected_item)
631 {
632  TV_ITEMW item;
633  TV_ITEMDATA *item_data;
634  SHFILEOPSTRUCTW fileop = { info->hwndTreeView };
635  WCHAR szzFrom[MAX_PATH + 1];
636 
637  /* get item_data */
638  item.mask = TVIF_HANDLE | TVIF_PARAM;
639  item.hItem = selected_item;
640  if (!SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item))
641  {
642  ERR("TVM_GETITEMW failed\n");
643  return;
644  }
645  item_data = (TV_ITEMDATA *)item.lParam;
646 
647  /* get the path */
648  if (!SHGetPathFromIDListW(item_data->lpifq, szzFrom))
649  {
650  ERR("SHGetPathFromIDListW failed\n");
651  return;
652  }
653  szzFrom[lstrlenW(szzFrom) + 1] = 0; /* double NULL-terminated */
654  fileop.pFrom = szzFrom;
655 
656  /* delete folder */
657  fileop.fFlags = FOF_ALLOWUNDO;
658  fileop.wFunc = FO_DELETE;
659  SHFileOperationW(&fileop);
660 }
661 #endif
663 {
664  HTREEITEM selected_item;
665 
666  /* Old dialog doesn't support those advanced features */
667  if (!(info->lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
668  return 0;
669 
670  selected_item = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_CARET, 0);
671 
672  switch (keydown->wVKey)
673  {
674  case VK_F2:
675  BrsFolder_Rename(info, selected_item);
676  break;
677  case VK_DELETE:
678  {
679 #ifdef __REACTOS__
680  BrsFolder_Delete(info, selected_item);
681 #else
682  const ITEMIDLIST *item_id;
683  ISFHelper *psfhlp;
684  HRESULT hr;
685  TVITEMW item;
686  TV_ITEMDATA *item_data;
687 
688  item.mask = TVIF_PARAM;
689  item.mask = TVIF_HANDLE|TVIF_PARAM;
690  item.hItem = selected_item;
691  SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item);
692  item_data = (TV_ITEMDATA *)item.lParam;
693  item_id = item_data->lpi;
694 
695  hr = IShellFolder_QueryInterface(item_data->lpsfParent, &IID_ISFHelper, (void**)&psfhlp);
696  if(FAILED(hr))
697  return 0;
698 
699  /* perform the item deletion - tree view gets updated over shell notification */
700  ISFHelper_DeleteItems(psfhlp, 1, &item_id);
701  ISFHelper_Release(psfhlp);
702 #endif
703  }
704  break;
705  }
706  return 0;
707 }
708 
710 {
711  NMTREEVIEWW *pnmtv = (NMTREEVIEWW *)lpnmh;
712 
713  TRACE("%p %x %p msg=%x\n", info, CtlID, lpnmh, pnmtv->hdr.code);
714 
716  return 0;
717 
718  switch (pnmtv->hdr.code)
719  {
720  case TVN_DELETEITEMA:
721  case TVN_DELETEITEMW:
722  return BrsFolder_Treeview_Delete( info, pnmtv );
723 
724  case TVN_ITEMEXPANDINGA:
725  case TVN_ITEMEXPANDINGW:
726  return BrsFolder_Treeview_Expand( info, pnmtv );
727 
728  case TVN_SELCHANGEDA:
729  case TVN_SELCHANGEDW:
730  return BrsFolder_Treeview_Changed( info, pnmtv );
731 
732  case TVN_ENDLABELEDITA:
733  case TVN_ENDLABELEDITW:
735 
736  case TVN_KEYDOWN:
738 
739  default:
740  WARN("unhandled (%d)\n", pnmtv->hdr.code);
741  break;
742  }
743 
744  return 0;
745 }
746 
747 
749 {
750  LPITEMIDLIST computer_pidl;
751  SHChangeNotifyEntry ntreg;
752  LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
753 
754  info->hWnd = hWnd;
756 
757  if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
758  FIXME("flags BIF_NEWDIALOGSTYLE partially implemented\n");
759  if (lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS)
760  FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS);
761 
762  if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
763  {
764  RECT rcWnd;
765 
767 
768  /* TODO: Windows allows shrinking the windows a bit */
769  GetWindowRect(hWnd, &rcWnd);
770  info->szMin.cx = rcWnd.right - rcWnd.left;
771  info->szMin.cy = rcWnd.bottom - rcWnd.top;
772  }
773  else
774  {
775  info->layout = NULL;
776  }
777 
778  if (lpBrowseInfo->lpszTitle)
780  else
782 
783  if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT)
784  || (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
786 
787  /* Hide "Make New Folder" Button? */
788  if ((lpBrowseInfo->ulFlags & BIF_NONEWFOLDERBUTTON)
789  || !(lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
791 
792  /* Hide the editbox? */
793  if (!(lpBrowseInfo->ulFlags & BIF_EDITBOX))
794  {
797  }
798 
800  if (info->hwndTreeView)
801  {
803 
804  /* Resize the treeview if there's not editbox */
805  if ((lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
806  && !(lpBrowseInfo->ulFlags & BIF_EDITBOX))
807  {
808  RECT rc;
809  GetClientRect(info->hwndTreeView, &rc);
810  SetWindowPos(info->hwndTreeView, HWND_TOP, 0, 0,
811  rc.right, rc.bottom + 40, SWP_NOMOVE);
812  }
813  }
814  else
815  ERR("treeview control missing!\n");
816 
817  /* Register for change notifications */
818  SHGetFolderLocation(NULL, CSIDL_DESKTOP, NULL, 0, &computer_pidl);
819 
820  ntreg.pidl = computer_pidl;
821  ntreg.fRecursive = TRUE;
822 
824 
825  browsefolder_callback( info->lpBrowseInfo, hWnd, BFFM_INITIALIZED, 0 );
826 
827  return TRUE;
828 }
829 
831 {
832  DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
833  IShellFolder *desktop, *cur;
834 #ifdef __REACTOS__
835  WCHAR wszNewFolder[25];
837 #else
838  ISFHelper *sfhelper;
839 #endif
841  HTREEITEM parent, added;
842  LPTV_ITEMDATA item_data;
843  LPITEMIDLIST new_item;
844  TVITEMW item;
845  HRESULT hr;
846  int len;
847 
848 #ifdef __REACTOS__
849  hr = SHGetDesktopFolder(&desktop);
850  if(FAILED(hr))
851  return hr;
852 
853  if (info->pidlRet)
854  {
855  hr = IShellFolder_BindToObject(desktop, info->pidlRet, 0, &IID_IShellFolder, (void**)&cur);
856  IShellFolder_Release(desktop);
857  if(FAILED(hr))
858  return hr;
859 
860  hr = SHGetPathFromIDListW(info->pidlRet, path);
861  }
862  else
863  {
864  cur = desktop;
866  }
867  if(FAILED(hr))
868  return hr;
869 
870  if (!LoadStringW(shell32_hInstance, IDS_NEWFOLDER, wszNewFolder, _countof(wszNewFolder)))
871  return E_FAIL;
872 
873  if (!PathYetAnotherMakeUniqueName(name, path, NULL, wszNewFolder))
874  return E_FAIL;
875 
876  len = strlenW(path);
877  if(len<MAX_PATH && name[len] == L'\\')
878  len++;
879 #else
880  if(!info->pidlRet) {
881  ERR("Make new folder button should be disabled\n");
882  return E_FAIL;
883  }
884 
885  /* Create new directory */
886  hr = SHGetDesktopFolder(&desktop);
887  if(FAILED(hr))
888  return hr;
889 
890  hr = IShellFolder_BindToObject(desktop, info->pidlRet, 0, &IID_IShellFolder, (void**)&cur);
891  IShellFolder_Release(desktop);
892  if(FAILED(hr))
893  return hr;
894 
895  hr = IShellFolder_QueryInterface(cur, &IID_ISFHelper, (void**)&sfhelper);
896  if(FAILED(hr))
897  return hr;
898 
899  if(!SHGetPathFromIDListW(info->pidlRet, name)) {
900  hr = E_FAIL;
901  goto cleanup;
902  }
903 
904  len = strlenW(name);
905  if(len<MAX_PATH)
906  name[len++] = '\\';
907  hr = ISFHelper_GetUniqueName(sfhelper, &name[len], MAX_PATH-len);
908  ISFHelper_Release(sfhelper);
909  if(FAILED(hr))
910  goto cleanup;
911 #endif
912 
913  hr = E_FAIL;
914  if(!CreateDirectoryW(name, NULL))
915  goto cleanup;
916 
917  /* Update parent of newly created directory */
919  if(!parent)
920  goto cleanup;
921 
922  SendMessageW(info->hwndTreeView, TVM_EXPAND, TVE_EXPAND, (LPARAM)parent);
923 
924  memset(&item, 0, sizeof(TVITEMW));
925  item.mask = TVIF_PARAM|TVIF_STATE;
926  item.hItem = parent;
927  SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item);
928  item_data = (LPTV_ITEMDATA)item.lParam;
929  if(!item_data)
930  goto cleanup;
931 
932  if(item_data->pEnumIL)
933  IEnumIDList_Release(item_data->pEnumIL);
934  hr = IShellFolder_EnumObjects(cur, info->hwndTreeView, flags, &item_data->pEnumIL);
935  if(FAILED(hr))
936  goto cleanup;
937 
938  /* Update treeview */
939  if(!(item.state&TVIS_EXPANDEDONCE)) {
940  item.mask = TVIF_STATE;
941  item.state = TVIS_EXPANDEDONCE;
942  item.stateMask = TVIS_EXPANDEDONCE;
943  SendMessageW(info->hwndTreeView, TVM_SETITEMW, 0, (LPARAM)&item);
944  }
945 
946  hr = IShellFolder_ParseDisplayName(cur, NULL, NULL, name+len, NULL, &new_item, NULL);
947  if(FAILED(hr))
948  goto cleanup;
949 
950  added = InsertTreeViewItem(info, cur, new_item, item_data->lpifq, NULL, parent);
951  IShellFolder_Release(cur);
952  SHFree(new_item);
953 
955  return BrsFolder_Rename(info, added);
956 
957 cleanup:
958  return hr;
959 }
960 
962 {
963  LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
964 
965  switch (id)
966  {
967  case IDOK:
968 #ifdef __REACTOS__
969  /* The original pidl is owned by the treeview and will be free'd. */
970  info->pidlRet = ILClone(info->pidlRet);
971 #endif
972  if (info->pidlRet == NULL) /* A null pidl would mean a cancel */
973  info->pidlRet = _ILCreateDesktop();
974  pdump( info->pidlRet );
975  if (lpBrowseInfo->pszDisplayName)
976  SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName );
977  EndDialog( info->hWnd, 1 );
978  return TRUE;
979 
980  case IDCANCEL:
981  EndDialog( info->hWnd, 0 );
982  return TRUE;
983 
986  return TRUE;
987  }
988  return FALSE;
989 }
990 
992  BOOL is_str, HTREEITEM *pItem)
993 {
994  LPITEMIDLIST pidlSelection = selection;
995  LPCITEMIDLIST pidlCurrent, pidlRoot;
996  TVITEMEXW item;
997  BOOL bResult = FALSE;
998 
999  memset(&item, 0, sizeof(item));
1000 
1001  /* If 'selection' is a string, convert to a Shell ID List. */
1002  if (is_str) {
1003  IShellFolder *psfDesktop;
1004  HRESULT hr;
1005 
1006  hr = SHGetDesktopFolder(&psfDesktop);
1007  if (FAILED(hr))
1008  goto done;
1009 
1010  hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL,
1011  selection, NULL, &pidlSelection, NULL);
1012  IShellFolder_Release(psfDesktop);
1013  if (FAILED(hr))
1014  goto done;
1015  }
1016 
1017  /* Move pidlCurrent behind the SHITEMIDs in pidlSelection, which are the root of
1018  * the sub-tree currently displayed. */
1019  pidlRoot = info->lpBrowseInfo->pidlRoot;
1020  pidlCurrent = pidlSelection;
1021  while (!_ILIsEmpty(pidlRoot) && _ILIsEqualSimple(pidlRoot, pidlCurrent)) {
1022  pidlRoot = ILGetNext(pidlRoot);
1023  pidlCurrent = ILGetNext(pidlCurrent);
1024  }
1025 
1026  /* The given ID List is not part of the SHBrowseForFolder's current sub-tree. */
1027  if (!_ILIsEmpty(pidlRoot))
1028  goto done;
1029 
1030  /* Initialize item to point to the first child of the root folder. */
1031  item.mask = TVIF_PARAM;
1032  item.hItem = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_ROOT, 0);
1033 
1034  if (item.hItem)
1035  item.hItem = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_CHILD,
1036  (LPARAM)item.hItem);
1037 
1038  /* Walk the tree along the nodes corresponding to the remaining ITEMIDLIST */
1039  while (item.hItem && !_ILIsEmpty(pidlCurrent)) {
1040  LPTV_ITEMDATA pItemData;
1041 
1042  SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item);
1043  pItemData = (LPTV_ITEMDATA)item.lParam;
1044 
1045  if (_ILIsEqualSimple(pItemData->lpi, pidlCurrent)) {
1046  pidlCurrent = ILGetNext(pidlCurrent);
1047  if (!_ILIsEmpty(pidlCurrent)) {
1048  /* Only expand current node and move on to its first child,
1049  * if we didn't already reach the last SHITEMID */
1050  SendMessageW(info->hwndTreeView, TVM_EXPAND, TVE_EXPAND, (LPARAM)item.hItem);
1051  item.hItem = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_CHILD,
1052  (LPARAM)item.hItem);
1053  }
1054  } else {
1055  item.hItem = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_NEXT,
1056  (LPARAM)item.hItem);
1057  }
1058  }
1059 
1060  if (_ILIsEmpty(pidlCurrent) && item.hItem)
1061  bResult = TRUE;
1062 
1063 done:
1064  if (pidlSelection && pidlSelection != selection)
1065  ILFree(pidlSelection);
1066 
1067  if (pItem)
1068  *pItem = item.hItem;
1069 
1070  return bResult;
1071 }
1072 
1074  HTREEITEM hItem;
1075  BOOL bResult;
1076 
1077  if (!selection) return FALSE;
1078 
1079  bResult = BrsFolder_OnSetExpanded(info, selection, is_str, &hItem);
1080  if (bResult)
1081  SendMessageW(info->hwndTreeView, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hItem );
1082  return bResult;
1083 }
1084 
1086  LPWSTR selectionW = NULL;
1087  BOOL result = FALSE;
1088  int length;
1089 
1090  if (!is_str)
1091  return BrsFolder_OnSetSelectionW(info, selection, is_str);
1092 
1093  if ((length = MultiByteToWideChar(CP_ACP, 0, selection, -1, NULL, 0)) &&
1094  (selectionW = HeapAlloc(GetProcessHeap(), 0, length * sizeof(WCHAR))) &&
1095  MultiByteToWideChar(CP_ACP, 0, selection, -1, selectionW, length))
1096  {
1097  result = BrsFolder_OnSetSelectionW(info, selectionW, is_str);
1098  }
1099 
1100  HeapFree(GetProcessHeap(), 0, selectionW);
1101  return result;
1102 }
1103 
1105 {
1106  if ((info->lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE) && !(pos->flags & SWP_NOSIZE))
1107  {
1108  if (pos->cx < info->szMin.cx)
1109  pos->cx = info->szMin.cx;
1110  if (pos->cy < info->szMin.cy)
1111  pos->cy = info->szMin.cy;
1112  }
1113  return 0;
1114 }
1115 
1117 {
1118  if (info->layout)
1119  {
1120  SHFree(info->layout);
1121  info->layout = NULL;
1122  }
1123 
1124  SHChangeNotifyDeregister(info->hNotify);
1125 
1126  return 0;
1127 }
1128 
1129 /* Find a treeview node by recursively walking the treeview */
1131 {
1132  TV_ITEMW item;
1133  TV_ITEMDATA *item_data;
1134  HRESULT hr;
1135 
1136  item.mask = TVIF_HANDLE | TVIF_PARAM;
1137  item.hItem = hItem;
1138  SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item);
1139  item_data = (TV_ITEMDATA *)item.lParam;
1140 
1141  hr = IShellFolder_CompareIDs(item_data->lpsfParent, 0, item_data->lpifq, pidl);
1142  if(SUCCEEDED(hr) && !HRESULT_CODE(hr))
1143  return hItem;
1144 
1146 
1147  while (hItem)
1148  {
1149  HTREEITEM newItem = BrsFolder_FindItemByPidl(info, pidl, hItem);
1150  if (newItem)
1151  return newItem;
1153  }
1154  return NULL;
1155 }
1156 
1158 {
1159  BOOL ret = TRUE;
1160 
1161  TRACE("(%p)->(%p, %p, 0x%08x)\n", info, pidls[0], pidls[1], event);
1162 
1163  switch (event)
1164  {
1165  case SHCNE_RMDIR:
1166  case SHCNE_DELETE:
1167  {
1168  HTREEITEM handle_root = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_ROOT, 0);
1169  HTREEITEM handle_item = BrsFolder_FindItemByPidl(info, pidls[0], handle_root);
1170 
1171  if (handle_item)
1172  SendMessageW(info->hwndTreeView, TVM_DELETEITEM, 0, (LPARAM)handle_item);
1173 
1174  break;
1175  }
1176  }
1177  return ret;
1178 }
1179 
1180 /*************************************************************************
1181  * BrsFolderDlgProc32 (not an exported API function)
1182  */
1184  LPARAM lParam )
1185 {
1186  browse_info *info;
1187 
1188  TRACE("hwnd=%p msg=%04x 0x%08lx 0x%08lx\n", hWnd, msg, wParam, lParam );
1189 
1190  if (msg == WM_INITDIALOG)
1191  return BrsFolder_OnCreate( hWnd, (browse_info*) lParam );
1192 
1194 
1195  switch (msg)
1196  {
1197  case WM_NOTIFY:
1199 
1200  case WM_COMMAND:
1201  return BrsFolder_OnCommand( info, wParam );
1202 
1203  case WM_WINDOWPOSCHANGING:
1205 
1206  case WM_SIZE:
1207  if (info->layout) /* new style dialogs */
1209  return 0;
1210 
1211  case BFFM_SETSTATUSTEXTA:
1212  TRACE("Set status %s\n", debugstr_a((LPSTR)lParam));
1214  break;
1215 
1216  case BFFM_SETSTATUSTEXTW:
1217  TRACE("Set status %s\n", debugstr_w((LPWSTR)lParam));
1219  break;
1220 
1221  case BFFM_ENABLEOK:
1222  TRACE("Enable %ld\n", lParam);
1223  EnableWindow(GetDlgItem(hWnd, 1), lParam != 0);
1224  break;
1225 
1226  case BFFM_SETOKTEXT: /* unicode only */
1227  TRACE("Set OK text %s\n", debugstr_w((LPWSTR)lParam));
1229  break;
1230 
1231  case BFFM_SETSELECTIONA:
1233 
1234  case BFFM_SETSELECTIONW:
1236 
1237  case BFFM_SETEXPANDED: /* unicode only */
1239 
1240  case SHV_CHANGE_NOTIFY:
1242 
1243  case WM_DESTROY:
1244  return BrsFolder_OnDestroy(info);
1245  }
1246  return FALSE;
1247 }
1248 
1249 #ifndef __REACTOS__
1250 static const WCHAR swBrowseTemplateName[] = {
1251  'S','H','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0};
1252 static const WCHAR swNewBrowseTemplateName[] = {
1253  'S','H','N','E','W','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0};
1254 #endif
1255 
1256 /*************************************************************************
1257  * SHBrowseForFolderA [SHELL32.@]
1258  * SHBrowseForFolder [SHELL32.@]
1259  */
1261 {
1262  BROWSEINFOW bi;
1263  LPITEMIDLIST lpid;
1264  INT len;
1265  LPWSTR title;
1266 
1267  TRACE("%p\n", lpbi);
1268 
1269  bi.hwndOwner = lpbi->hwndOwner;
1270  bi.pidlRoot = lpbi->pidlRoot;
1271  if (lpbi->pszDisplayName)
1272  bi.pszDisplayName = HeapAlloc( GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR) );
1273  else
1274  bi.pszDisplayName = NULL;
1275 
1276  if (lpbi->lpszTitle)
1277  {
1278  len = MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, NULL, 0 );
1279  title = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
1280  MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, title, len );
1281  }
1282  else
1283  title = NULL;
1284 
1285  bi.lpszTitle = title;
1286  bi.ulFlags = lpbi->ulFlags;
1287  bi.lpfn = lpbi->lpfn;
1288  bi.lParam = lpbi->lParam;
1289  bi.iImage = lpbi->iImage;
1290  lpid = SHBrowseForFolderW( &bi );
1291  if (bi.pszDisplayName)
1292  {
1294  lpbi->pszDisplayName, MAX_PATH, 0, NULL);
1296  }
1297  HeapFree(GetProcessHeap(), 0, title);
1298  lpbi->iImage = bi.iImage;
1299  return lpid;
1300 }
1301 
1302 
1303 /*************************************************************************
1304  * SHBrowseForFolderW [SHELL32.@]
1305  *
1306  * NOTES
1307  * crashes when passed a null pointer
1308  */
1310 {
1311  browse_info info;
1312  DWORD r;
1313  HRESULT hr;
1314 #ifdef __REACTOS__
1315  WORD wDlgId;
1316 #else
1317  const WCHAR * templateName;
1318  INITCOMMONCONTROLSEX icex;
1319 #endif
1320 
1321  info.hWnd = 0;
1322  info.pidlRet = NULL;
1323  info.lpBrowseInfo = lpbi;
1324  info.hwndTreeView = NULL;
1325 
1326 #ifndef __REACTOS__
1327  icex.dwSize = sizeof( icex );
1328  icex.dwICC = ICC_TREEVIEW_CLASSES;
1329  InitCommonControlsEx( &icex );
1330 #endif
1331 
1332  hr = OleInitialize(NULL);
1333 
1334  if (lpbi->ulFlags & BIF_NEWDIALOGSTYLE)
1335  wDlgId = IDD_BROWSE_FOR_FOLDER_NEW;
1336  else
1337  wDlgId = IDD_BROWSE_FOR_FOLDER;
1340  if (SUCCEEDED(hr))
1341  OleUninitialize();
1342  if (!r)
1343  {
1344  ILFree(info.pidlRet);
1345  return NULL;
1346  }
1347 
1348  return info.pidlRet;
1349 }
WINE_DEFAULT_DEBUG_CHANNEL(shell)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
static LRESULT BrsFolder_Treeview_Expand(browse_info *info, NMTREEVIEWW *pnmtv)
Definition: brsfolder.c:529
#define IDC_BROWSE_FOR_FOLDER_FOLDER_TEXT
Definition: shresdef.h:376
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDC_BROWSE_FOR_FOLDER_STATUS
Definition: shresdef.h:378
struct tagLAYOUT_DATA LAYOUT_DATA
int cchTextMax
Definition: commctrl.h:3317
#define SHGFI_SYSICONINDEX
Definition: shellapi.h:169
#define IDS_NEWFOLDER
static BOOL BrsFolder_OnSetSelectionA(browse_info *info, LPVOID selection, BOOL is_str)
Definition: brsfolder.c:1085
#define TRUE
Definition: types.h:120
#define SHCNE_RMDIR
Definition: shlobj.h:1733
#define IDOK
Definition: winuser.h:824
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2170
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
HTREEITEM hParent
Definition: commctrl.h:3389
LPITEMIDLIST _ILCreateDesktop(void)
Definition: pidl.c:1596
TVITEMW itemOld
Definition: commctrl.h:3633
static BOOL _ILIsEmpty(LPCITEMIDLIST pidl)
Definition: pidl.h:256
static HTREEITEM InsertTreeViewItem(browse_info *, IShellFolder *, LPCITEMIDLIST, LPCITEMIDLIST, IEnumIDList *, HTREEITEM)
Definition: brsfolder.c:364
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define WideCharToMultiByte
Definition: compat.h:101
static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM)
Definition: brsfolder.c:296
HRESULT hr
Definition: shlfolder.c:183
struct tagTV_ITEMDATA * LPTV_ITEMDATA
#define TV_ITEMW
Definition: commctrl.h:3293
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define TVM_EXPAND
Definition: commctrl.h:3415
#define TVM_SELECTITEM
Definition: commctrl.h:3474
LPITEMIDLIST lpifq
Definition: brsfolder.c:68
#define TVM_SORTCHILDREN
Definition: commctrl.h:3537
#define TVGN_CARET
Definition: commctrl.h:3457
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1914
#define CSIDL_DESKTOP
Definition: shlobj.h:2012
#define TVN_DELETEITEMA
Definition: commctrl.h:3703
static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName)
Definition: brsfolder.c:334
#define SW_HIDE
Definition: winuser.h:762
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LAYOUT_INFO_COUNT
Definition: brsfolder.c:91
#define CP_ACP
Definition: compat.h:99
int iImage
Definition: commctrl.h:3318
static void BrsFolder_CheckValidSelection(browse_info *info, LPTV_ITEMDATA lptvid)
Definition: brsfolder.c:478
#define WARN(fmt,...)
Definition: debug.h:112
static HRESULT BrsFolder_Treeview_Changed(browse_info *info, NMTREEVIEWW *pnmtv)
Definition: brsfolder.c:564
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
#define TVGN_NEXT
Definition: commctrl.h:3449
struct _TREEITEM * HTREEITEM
Definition: commctrl.h:3260
#define BIF_BROWSEINCLUDEFILES
Definition: shlobj.h:1159
static LRESULT BrsFolder_OnChange(browse_info *info, const LPCITEMIDLIST *pidls, LONG event)
Definition: brsfolder.c:1157
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1288
#define CALLBACK
Definition: compat.h:27
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
HWND hWnd
Definition: settings.c:17
LPARAM lParam
Definition: commctrl.h:3321
static BOOL PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type)
Definition: brsfolder.c:470
#define BF_BOTTOM
Definition: winuser.h:457
#define BFFM_INITIALIZED
Definition: shlobj.h:1163
LONG top
Definition: windef.h:307
#define FOF_ALLOWUNDO
Definition: shellapi.h:144
LAYOUT_DATA * layout
Definition: brsfolder.c:59
HWND hwndOwner
Definition: shlobj.h:1127
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define HWND_TOP
Definition: winuser.h:1193
#define BFFM_SETSELECTIONA
Definition: shlobj.h:1172
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT_PTR WPARAM
Definition: windef.h:207
#define BIF_NONEWFOLDERBUTTON
Definition: shlobj.h:1154
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:212
#define TVIS_EXPANDEDONCE
Definition: commctrl.h:3281
#define BIF_EDITBOX
Definition: shlobj.h:1148
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3267
LONG left
Definition: windef.h:306
#define SWP_NOZORDER
Definition: winuser.h:1232
UINT uFlags
Definition: api.c:59
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
UINT mask
Definition: commctrl.h:3312
int32_t INT_PTR
Definition: typedefs.h:63
char * LPSTR
Definition: xmlstorage.h:182
FILEOP_FLAGS fFlags
Definition: shellapi.h:357
LONG right
Definition: windef.h:308
#define lstrlenW
Definition: compat.h:416
#define E_FAIL
Definition: ddrawi.h:102
struct tagLAYOUT_INFO LAYOUT_INFO
LPWSTR pszText
Definition: commctrl.h:3316
BFFCALLBACK lpfn
Definition: shlobj.h:1121
#define SHGFI_SMALLICON
Definition: shellapi.h:174
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:57
int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
Definition: shlfileop.cpp:1914
static BOOLEAN bSuccess
Definition: drive.cpp:419
#define BFFM_SETEXPANDED
Definition: shlobj.h:1176
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
int selection
Definition: ctm.c:92
DWORD dwAttributes
Definition: vdmdbg.h:34
static BOOL _ILIsEqualSimple(LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB)
Definition: pidl.h:250
#define IDC_BROWSE_FOR_FOLDER_TITLE
Definition: shresdef.h:379
struct _test_info info[]
Definition: SetCursorPos.c:19
#define TVN_SELCHANGEDA
Definition: commctrl.h:3643
UINT code
Definition: winuser.h:3134
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3408
#define TVN_ENDLABELEDITW
Definition: commctrl.h:3708
static DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
Definition: brsfolder.c:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static HRESULT BrsFolder_Rename(browse_info *info, HTREEITEM rename)
Definition: brsfolder.c:621
#define ICC_TREEVIEW_CLASSES
Definition: commctrl.h:59
static LRESULT BrsFolder_OnNotify(browse_info *info, UINT CtlID, LPNMHDR lpnmh)
Definition: brsfolder.c:709
LPSTR pszDisplayName
Definition: shlobj.h:1118
#define TVM_SETITEMW
Definition: commctrl.h:3489
_Check_return_ int __cdecl rename(_In_z_ const char *_OldFilename, _In_z_ const char *_NewFilename)
#define TVIF_CHILDREN
Definition: commctrl.h:3268
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
HWND hwndTreeView
Definition: brsfolder.c:56
HTREEITEM hInsertAfter
Definition: commctrl.h:3390
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SHCNE_ALLEVENTS
Definition: shlobj.h:1753
long LONG
Definition: pedump.c:60
LPWSTR pszDisplayName
Definition: shlobj.h:1129
IEnumIDList * pEnumIL
Definition: brsfolder.c:69
UINT_PTR idFrom
Definition: winuser.h:3133
#define debugstr_w
Definition: kernel32.h:32
#define SHGFI_PIDL
Definition: shellapi.h:178
#define FIXME(fmt,...)
Definition: debug.h:111
BOOL WINAPI MoveFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName)
Definition: move.c:1044
#define BIF_RETURNFSANCESTORS
Definition: shlobj.h:1147
#define TVM_SETIMAGELIST
Definition: commctrl.h:3442
#define VK_F2
Definition: winuser.h:2231
HTREEITEM hItem
Definition: treelist.h:37
const WCHAR * str
#define TVGN_ROOT
Definition: commctrl.h:3448
#define SHCNRF_InterruptLevel
Definition: shlobj.h:1774
smooth NULL
Definition: ftsmooth.c:416
#define SHGFI_OPENICON
Definition: shellapi.h:176
#define SHV_CHANGE_NOTIFY
Definition: brsfolder.c:44
#define IDC_WAIT
Definition: winuser.h:684
#define BFFM_SETSELECTIONW
Definition: shlobj.h:1173
ULONG hNotify
Definition: brsfolder.c:61
LONG_PTR LPARAM
Definition: windef.h:208
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:189
LPITEMIDLIST pidlRet
Definition: brsfolder.c:58
static BOOL BrsFolder_OnSetSelectionW(browse_info *info, LPVOID selection, BOOL is_str)
Definition: brsfolder.c:1073
LPSHELLFOLDER lpsfParent
Definition: brsfolder.c:66
#define IDD_BROWSE_FOR_FOLDER
Definition: shresdef.h:373
#define TVN_ITEMEXPANDINGW
Definition: commctrl.h:3696
int cChildren
Definition: commctrl.h:3320
#define TVN_SELCHANGEDW
Definition: commctrl.h:3644
#define IDC_BROWSE_FOR_FOLDER_FOLDER
Definition: shresdef.h:377
#define VK_DELETE
Definition: winuser.h:2208
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
static const WCHAR swNewBrowseTemplateName[]
Definition: brsfolder.c:1252
#define WM_DESTROY
Definition: winuser.h:1591
#define TVN_DELETEITEMW
Definition: commctrl.h:3704
static LAYOUT_DATA * LayoutInit(HWND hwnd, const LAYOUT_INFO *layout_info, int layout_count)
Definition: brsfolder.c:125
LPCWSTR lpszTitle
Definition: shlobj.h:1130
TVITEMW itemNew
Definition: commctrl.h:3634
BYTE PIDLTYPE
Definition: pidl.h:108
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define BIF_STATUSTEXT
Definition: shlobj.h:1146
#define BIF_NEWDIALOGSTYLE
Definition: shlobj.h:1150
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
r parent
Definition: btrfs.c:2944
if(!(yy_init))
Definition: macro.lex.yy.c:714
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath)
Definition: pidl.c:1115
__wchar_t WCHAR
Definition: xmlstorage.h:180
static void LayoutUpdate(HWND hwnd, LAYOUT_DATA *data, const LAYOUT_INFO *layout_info, int layout_count)
Definition: brsfolder.c:154
#define TVM_EDITLABELW
Definition: commctrl.h:3496
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:413
#define WM_SIZE
Definition: winuser.h:1593
#define debugstr_a
Definition: kernel32.h:31
static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection, BOOL is_str, HTREEITEM *pItem)
Definition: brsfolder.c:991
LONG HRESULT
Definition: typedefs.h:78
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
#define BF_RIGHT
Definition: winuser.h:456
EXTERN_C BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
#define _countof(array)
Definition: sndvol32.h:68
#define TVN_ENDLABELEDITA
Definition: commctrl.h:3707
LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi)
Definition: brsfolder.c:1260
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:6
unsigned short WORD
Definition: ntddk_ex.h:93
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1117
unsigned long DWORD
Definition: ntddk_ex.h:95
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define TVE_EXPAND
Definition: commctrl.h:3419
GLbitfield flags
Definition: glext.h:7161
#define TVI_ROOT
Definition: commctrl.h:3364
LPCSTR lpszTitle
Definition: shlobj.h:1119
LPCWSTR pFrom
Definition: shellapi.h:355
int ret
#define TVM_DELETEITEM
Definition: commctrl.h:3410
static const WCHAR L[]
Definition: oid.c:1250
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
static HRESULT BrsFolder_NewFolder(browse_info *info)
Definition: brsfolder.c:830
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static LRESULT BrsFolder_OnWindowPosChanging(browse_info *info, WINDOWPOS *pos)
Definition: brsfolder.c:1104
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
PCIDLIST_ABSOLUTE pidl
Definition: shlobj.h:1725
#define WM_COMMAND
Definition: winuser.h:1722
struct _cl_event * event
Definition: glext.h:7739
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1128
#define TVGN_CHILD
Definition: commctrl.h:3452
static int GetIcon(LPCITEMIDLIST lpi, UINT uFlags)
Definition: brsfolder.c:289
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
#define IDD_BROWSE_FOR_FOLDER_NEW
Definition: shresdef.h:374
static LRESULT BrsFolder_Treeview_Keydown(browse_info *info, LPNMTVKEYDOWN keydown)
Definition: brsfolder.c:662
UINT ulFlags
Definition: shlobj.h:1120
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:706
#define TVIF_HANDLE
Definition: commctrl.h:3266
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brsfolder.c:1309
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
#define SWP_NOSIZE
Definition: winuser.h:1230
#define ERR(fmt,...)
Definition: debug.h:110
#define TVM_GETNEXTITEM
Definition: commctrl.h:3445
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define BFFM_ENABLEOK
Definition: shlobj.h:1171
HWND WINAPI GetParent(_In_ HWND)
#define PT_COMP
Definition: pidl.h:99
static LRESULT BrsFolder_Treeview_Rename(browse_info *info, NMTVDISPINFOW *pnmtv)
Definition: brsfolder.c:581
LPARAM lParam
Definition: shlobj.h:1122
#define S_OK
Definition: intsafe.h:59
HWND WINAPI SetCapture(_In_ HWND hWnd)
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
UINT ulFlags
Definition: shlobj.h:1131
static INT BrsFolder_OnDestroy(browse_info *info)
Definition: brsfolder.c:1116
static ATOM item
Definition: dde.c:856
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1144
LPARAM lParam
Definition: shlobj.h:1133
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
static void browsefolder_callback(LPBROWSEINFOW lpBrowseInfo, HWND hWnd, UINT msg, LPARAM param)
Definition: brsfolder.c:117
#define TVIF_TEXT
Definition: commctrl.h:3262
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
static BOOL BrsFolder_OnCommand(browse_info *info, UINT id)
Definition: brsfolder.c:961
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define SHCNE_DELETE
Definition: shlobj.h:1731
int iSelectedImage
Definition: commctrl.h:3319
static void InitializeTreeView(browse_info *info)
Definition: brsfolder.c:196
#define BF_TOP
Definition: winuser.h:455
#define BFFM_SELCHANGED
Definition: shlobj.h:1164
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BFFM_SETSTATUSTEXTA
Definition: shlobj.h:1170
BFFCALLBACK lpfn
Definition: shlobj.h:1132
#define TVIF_IMAGE
Definition: commctrl.h:3263
#define SUPPORTEDFLAGS
Definition: brsfolder.c:93
#define IDC_BROWSE_FOR_FOLDER_TREEVIEW
Definition: shresdef.h:380
#define HWND_DESKTOP
Definition: winuser.h:1195
static void FillTreeView(browse_info *, LPSHELLFOLDER, LPITEMIDLIST, HTREEITEM, IEnumIDList *)
unsigned int UINT
Definition: ndis.h:50
HTREEITEM hItem
Definition: commctrl.h:3313
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
static BOOL BrsFolder_OnCreate(HWND hWnd, browse_info *info)
Definition: brsfolder.c:748
static const WCHAR swBrowseTemplateName[]
Definition: brsfolder.c:1250
#define MultiByteToWideChar
Definition: compat.h:100
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2889
#define HRESULT_CODE(hr)
Definition: winerror.h:76
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2208
Definition: name.c:38
TVITEMW item
Definition: commctrl.h:3668
static const WCHAR szBrowseFolderInfo[]
Definition: brsfolder.c:106
LPBROWSEINFOW lpBrowseInfo
Definition: brsfolder.c:57
EXTERN_C ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, INT fSources, LONG wEventMask, UINT uMsg, INT cItems, SHChangeNotifyEntry *lpItems)
unsigned int ULONG
Definition: retypes.h:1
static HTREEITEM BrsFolder_FindItemByPidl(browse_info *info, LPCITEMIDLIST pidl, HTREEITEM hItem)
Definition: brsfolder.c:1130
LONG bottom
Definition: windef.h:309
#define TVIF_STATE
Definition: commctrl.h:3265
char * cleanup(char *str)
Definition: wpickclick.c:99
#define TVM_GETITEMW
Definition: commctrl.h:3482
UINT state
Definition: commctrl.h:3314
#define SWP_NOMOVE
Definition: winuser.h:1229
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:2741
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI PathYetAnotherMakeUniqueName(LPWSTR buffer, LPCWSTR path, LPCWSTR shortname, LPCWSTR longname)
Definition: shellpath.c:368
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define BFFM_SETOKTEXT
Definition: shlobj.h:1175
#define TVIF_PARAM
Definition: commctrl.h:3264
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2027
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: brsfolder.c:1183
LPITEMIDLIST lpi
Definition: brsfolder.c:67
LONG_PTR LRESULT
Definition: windef.h:209
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
HWND hwndOwner
Definition: shlobj.h:1116
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define BFFM_SETSTATUSTEXTW
Definition: shlobj.h:1174
#define FO_DELETE
Definition: shellapi.h:135
#define BIF_BROWSEFORCOMPUTER
Definition: shlobj.h:1157
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
static char title[]
Definition: ps.c:92
#define TVN_KEYDOWN
Definition: commctrl.h:3709
static const LAYOUT_INFO g_layout_info[]
Definition: brsfolder.c:78
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309
#define HeapFree(x, y, z)
Definition: compat.h:403
DWORD dwAnchor
Definition: brsfolder.c:75
static LRESULT BrsFolder_Treeview_Delete(browse_info *info, NMTREEVIEWW *pnmtv)
Definition: brsfolder.c:514
struct tagbrowse_info browse_info
#define WM_NOTIFY
Definition: richedit.h:61
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
#define IDC_BROWSE_FOR_FOLDER_NEW_FOLDER
Definition: shresdef.h:375
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define BF_LEFT
Definition: winuser.h:454
#define TVN_ITEMEXPANDINGA
Definition: commctrl.h:3695
struct tagTV_ITEMDATA TV_ITEMDATA