ReactOS  0.4.14-dev-1276-g8aa58c1
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 
629 {
630  HTREEITEM selected_item;
631 
632  /* Old dialog doesn't support those advanced features */
633  if (!(info->lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
634  return 0;
635 
636  selected_item = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_CARET, 0);
637 
638  switch (keydown->wVKey)
639  {
640  case VK_F2:
641  BrsFolder_Rename(info, selected_item);
642  break;
643  case VK_DELETE:
644  {
645 #ifdef __REACTOS__
646  /*********************************************************
647  FIXME: Add a proper alternative implementation for ReactOS
648 
649  NOTES: Wine makes use of the ISFHelper interface, which we
650  don't have in ReactOS.
651  It's defined in dlls/shell32/shellfolder.h and implemented
652  in dlls/shell32/shfldr_fs.c on Wine's side.
653  *********************************************************/
654 #else
655  const ITEMIDLIST *item_id;
656  ISFHelper *psfhlp;
657  HRESULT hr;
658  TVITEMW item;
659  TV_ITEMDATA *item_data;
660 
661  item.mask = TVIF_PARAM;
662  item.mask = TVIF_HANDLE|TVIF_PARAM;
663  item.hItem = selected_item;
664  SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item);
665  item_data = (TV_ITEMDATA *)item.lParam;
666  item_id = item_data->lpi;
667 
668  hr = IShellFolder_QueryInterface(item_data->lpsfParent, &IID_ISFHelper, (void**)&psfhlp);
669  if(FAILED(hr))
670  return 0;
671 
672  /* perform the item deletion - tree view gets updated over shell notification */
673  ISFHelper_DeleteItems(psfhlp, 1, &item_id);
674  ISFHelper_Release(psfhlp);
675 #endif
676  }
677  break;
678  }
679  return 0;
680 }
681 
683 {
684  NMTREEVIEWW *pnmtv = (NMTREEVIEWW *)lpnmh;
685 
686  TRACE("%p %x %p msg=%x\n", info, CtlID, lpnmh, pnmtv->hdr.code);
687 
689  return 0;
690 
691  switch (pnmtv->hdr.code)
692  {
693  case TVN_DELETEITEMA:
694  case TVN_DELETEITEMW:
695  return BrsFolder_Treeview_Delete( info, pnmtv );
696 
697  case TVN_ITEMEXPANDINGA:
698  case TVN_ITEMEXPANDINGW:
699  return BrsFolder_Treeview_Expand( info, pnmtv );
700 
701  case TVN_SELCHANGEDA:
702  case TVN_SELCHANGEDW:
703  return BrsFolder_Treeview_Changed( info, pnmtv );
704 
705  case TVN_ENDLABELEDITA:
706  case TVN_ENDLABELEDITW:
708 
709  case TVN_KEYDOWN:
711 
712  default:
713  WARN("unhandled (%d)\n", pnmtv->hdr.code);
714  break;
715  }
716 
717  return 0;
718 }
719 
720 
722 {
723  LPITEMIDLIST computer_pidl;
724  SHChangeNotifyEntry ntreg;
725  LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
726 
727  info->hWnd = hWnd;
729 
730  if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
731  FIXME("flags BIF_NEWDIALOGSTYLE partially implemented\n");
732  if (lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS)
733  FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS);
734 
735  if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
736  {
737  RECT rcWnd;
738 
740 
741  /* TODO: Windows allows shrinking the windows a bit */
742  GetWindowRect(hWnd, &rcWnd);
743  info->szMin.cx = rcWnd.right - rcWnd.left;
744  info->szMin.cy = rcWnd.bottom - rcWnd.top;
745  }
746  else
747  {
748  info->layout = NULL;
749  }
750 
751  if (lpBrowseInfo->lpszTitle)
753  else
755 
756  if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT)
757  || (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
759 
760  /* Hide "Make New Folder" Button? */
761  if ((lpBrowseInfo->ulFlags & BIF_NONEWFOLDERBUTTON)
762  || !(lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
764 
765  /* Hide the editbox? */
766  if (!(lpBrowseInfo->ulFlags & BIF_EDITBOX))
767  {
770  }
771 
773  if (info->hwndTreeView)
774  {
776 
777  /* Resize the treeview if there's not editbox */
778  if ((lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
779  && !(lpBrowseInfo->ulFlags & BIF_EDITBOX))
780  {
781  RECT rc;
782  GetClientRect(info->hwndTreeView, &rc);
783  SetWindowPos(info->hwndTreeView, HWND_TOP, 0, 0,
784  rc.right, rc.bottom + 40, SWP_NOMOVE);
785  }
786  }
787  else
788  ERR("treeview control missing!\n");
789 
790  /* Register for change notifications */
791  SHGetFolderLocation(NULL, CSIDL_DESKTOP, NULL, 0, &computer_pidl);
792 
793  ntreg.pidl = computer_pidl;
794  ntreg.fRecursive = TRUE;
795 
797 
798  browsefolder_callback( info->lpBrowseInfo, hWnd, BFFM_INITIALIZED, 0 );
799 
800  return TRUE;
801 }
802 
804 {
805  DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
806  IShellFolder *desktop, *cur;
807 #ifdef __REACTOS__
808  WCHAR wszNewFolder[25];
810 #else
811  ISFHelper *sfhelper;
812 #endif
814  HTREEITEM parent, added;
815  LPTV_ITEMDATA item_data;
816  LPITEMIDLIST new_item;
817  TVITEMW item;
818  HRESULT hr;
819  int len;
820 
821 #ifdef __REACTOS__
822  hr = SHGetDesktopFolder(&desktop);
823  if(FAILED(hr))
824  return hr;
825 
826  if (info->pidlRet)
827  {
828  hr = IShellFolder_BindToObject(desktop, info->pidlRet, 0, &IID_IShellFolder, (void**)&cur);
829  IShellFolder_Release(desktop);
830  if(FAILED(hr))
831  return hr;
832 
833  hr = SHGetPathFromIDListW(info->pidlRet, path);
834  }
835  else
836  {
837  cur = desktop;
839  }
840  if(FAILED(hr))
841  return hr;
842 
843  if (!LoadStringW(shell32_hInstance, IDS_NEWFOLDER, wszNewFolder, _countof(wszNewFolder)))
844  return E_FAIL;
845 
846  if (!PathYetAnotherMakeUniqueName(name, path, NULL, wszNewFolder))
847  return E_FAIL;
848 
849  len = strlenW(path);
850  if(len<MAX_PATH && name[len] == L'\\')
851  len++;
852 #else
853  if(!info->pidlRet) {
854  ERR("Make new folder button should be disabled\n");
855  return E_FAIL;
856  }
857 
858  /* Create new directory */
859  hr = SHGetDesktopFolder(&desktop);
860  if(FAILED(hr))
861  return hr;
862 
863  hr = IShellFolder_BindToObject(desktop, info->pidlRet, 0, &IID_IShellFolder, (void**)&cur);
864  IShellFolder_Release(desktop);
865  if(FAILED(hr))
866  return hr;
867 
868  hr = IShellFolder_QueryInterface(cur, &IID_ISFHelper, (void**)&sfhelper);
869  if(FAILED(hr))
870  return hr;
871 
872  if(!SHGetPathFromIDListW(info->pidlRet, name)) {
873  hr = E_FAIL;
874  goto cleanup;
875  }
876 
877  len = strlenW(name);
878  if(len<MAX_PATH)
879  name[len++] = '\\';
880  hr = ISFHelper_GetUniqueName(sfhelper, &name[len], MAX_PATH-len);
881  ISFHelper_Release(sfhelper);
882  if(FAILED(hr))
883  goto cleanup;
884 #endif
885 
886  hr = E_FAIL;
887  if(!CreateDirectoryW(name, NULL))
888  goto cleanup;
889 
890  /* Update parent of newly created directory */
892  if(!parent)
893  goto cleanup;
894 
895  SendMessageW(info->hwndTreeView, TVM_EXPAND, TVE_EXPAND, (LPARAM)parent);
896 
897  memset(&item, 0, sizeof(TVITEMW));
898  item.mask = TVIF_PARAM|TVIF_STATE;
899  item.hItem = parent;
900  SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item);
901  item_data = (LPTV_ITEMDATA)item.lParam;
902  if(!item_data)
903  goto cleanup;
904 
905  if(item_data->pEnumIL)
906  IEnumIDList_Release(item_data->pEnumIL);
907  hr = IShellFolder_EnumObjects(cur, info->hwndTreeView, flags, &item_data->pEnumIL);
908  if(FAILED(hr))
909  goto cleanup;
910 
911  /* Update treeview */
912  if(!(item.state&TVIS_EXPANDEDONCE)) {
913  item.mask = TVIF_STATE;
914  item.state = TVIS_EXPANDEDONCE;
915  item.stateMask = TVIS_EXPANDEDONCE;
916  SendMessageW(info->hwndTreeView, TVM_SETITEMW, 0, (LPARAM)&item);
917  }
918 
919  hr = IShellFolder_ParseDisplayName(cur, NULL, NULL, name+len, NULL, &new_item, NULL);
920  if(FAILED(hr))
921  goto cleanup;
922 
923  added = InsertTreeViewItem(info, cur, new_item, item_data->lpifq, NULL, parent);
924  IShellFolder_Release(cur);
925  SHFree(new_item);
926 
928  return BrsFolder_Rename(info, added);
929 
930 cleanup:
931  return hr;
932 }
933 
935 {
936  LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
937 
938  switch (id)
939  {
940  case IDOK:
941 #ifdef __REACTOS__
942  /* The original pidl is owned by the treeview and will be free'd. */
943  info->pidlRet = ILClone(info->pidlRet);
944 #endif
945  if (info->pidlRet == NULL) /* A null pidl would mean a cancel */
946  info->pidlRet = _ILCreateDesktop();
947  pdump( info->pidlRet );
948  if (lpBrowseInfo->pszDisplayName)
949  SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName );
950  EndDialog( info->hWnd, 1 );
951  return TRUE;
952 
953  case IDCANCEL:
954  EndDialog( info->hWnd, 0 );
955  return TRUE;
956 
959  return TRUE;
960  }
961  return FALSE;
962 }
963 
965  BOOL is_str, HTREEITEM *pItem)
966 {
967  LPITEMIDLIST pidlSelection = selection;
968  LPCITEMIDLIST pidlCurrent, pidlRoot;
969  TVITEMEXW item;
970  BOOL bResult = FALSE;
971 
972  memset(&item, 0, sizeof(item));
973 
974  /* If 'selection' is a string, convert to a Shell ID List. */
975  if (is_str) {
976  IShellFolder *psfDesktop;
977  HRESULT hr;
978 
979  hr = SHGetDesktopFolder(&psfDesktop);
980  if (FAILED(hr))
981  goto done;
982 
983  hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL,
984  selection, NULL, &pidlSelection, NULL);
985  IShellFolder_Release(psfDesktop);
986  if (FAILED(hr))
987  goto done;
988  }
989 
990  /* Move pidlCurrent behind the SHITEMIDs in pidlSelection, which are the root of
991  * the sub-tree currently displayed. */
992  pidlRoot = info->lpBrowseInfo->pidlRoot;
993  pidlCurrent = pidlSelection;
994  while (!_ILIsEmpty(pidlRoot) && _ILIsEqualSimple(pidlRoot, pidlCurrent)) {
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  goto done;
1002 
1003  /* Initialize item to point to the first child of the root folder. */
1004  item.mask = TVIF_PARAM;
1005  item.hItem = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_ROOT, 0);
1006 
1007  if (item.hItem)
1008  item.hItem = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_CHILD,
1009  (LPARAM)item.hItem);
1010 
1011  /* Walk the tree along the nodes corresponding to the remaining ITEMIDLIST */
1012  while (item.hItem && !_ILIsEmpty(pidlCurrent)) {
1013  LPTV_ITEMDATA pItemData;
1014 
1015  SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item);
1016  pItemData = (LPTV_ITEMDATA)item.lParam;
1017 
1018  if (_ILIsEqualSimple(pItemData->lpi, pidlCurrent)) {
1019  pidlCurrent = ILGetNext(pidlCurrent);
1020  if (!_ILIsEmpty(pidlCurrent)) {
1021  /* Only expand current node and move on to its first child,
1022  * if we didn't already reach the last SHITEMID */
1023  SendMessageW(info->hwndTreeView, TVM_EXPAND, TVE_EXPAND, (LPARAM)item.hItem);
1024  item.hItem = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_CHILD,
1025  (LPARAM)item.hItem);
1026  }
1027  } else {
1028  item.hItem = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_NEXT,
1029  (LPARAM)item.hItem);
1030  }
1031  }
1032 
1033  if (_ILIsEmpty(pidlCurrent) && item.hItem)
1034  bResult = TRUE;
1035 
1036 done:
1037  if (pidlSelection && pidlSelection != selection)
1038  ILFree(pidlSelection);
1039 
1040  if (pItem)
1041  *pItem = item.hItem;
1042 
1043  return bResult;
1044 }
1045 
1047  HTREEITEM hItem;
1048  BOOL bResult;
1049 
1050  if (!selection) return FALSE;
1051 
1052  bResult = BrsFolder_OnSetExpanded(info, selection, is_str, &hItem);
1053  if (bResult)
1054  SendMessageW(info->hwndTreeView, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hItem );
1055  return bResult;
1056 }
1057 
1059  LPWSTR selectionW = NULL;
1060  BOOL result = FALSE;
1061  int length;
1062 
1063  if (!is_str)
1064  return BrsFolder_OnSetSelectionW(info, selection, is_str);
1065 
1066  if ((length = MultiByteToWideChar(CP_ACP, 0, selection, -1, NULL, 0)) &&
1067  (selectionW = HeapAlloc(GetProcessHeap(), 0, length * sizeof(WCHAR))) &&
1068  MultiByteToWideChar(CP_ACP, 0, selection, -1, selectionW, length))
1069  {
1070  result = BrsFolder_OnSetSelectionW(info, selectionW, is_str);
1071  }
1072 
1073  HeapFree(GetProcessHeap(), 0, selectionW);
1074  return result;
1075 }
1076 
1078 {
1079  if ((info->lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE) && !(pos->flags & SWP_NOSIZE))
1080  {
1081  if (pos->cx < info->szMin.cx)
1082  pos->cx = info->szMin.cx;
1083  if (pos->cy < info->szMin.cy)
1084  pos->cy = info->szMin.cy;
1085  }
1086  return 0;
1087 }
1088 
1090 {
1091  if (info->layout)
1092  {
1093  SHFree(info->layout);
1094  info->layout = NULL;
1095  }
1096 
1097  SHChangeNotifyDeregister(info->hNotify);
1098 
1099  return 0;
1100 }
1101 
1102 /* Find a treeview node by recursively walking the treeview */
1104 {
1105  TV_ITEMW item;
1106  TV_ITEMDATA *item_data;
1107  HRESULT hr;
1108 
1109  item.mask = TVIF_HANDLE | TVIF_PARAM;
1110  item.hItem = hItem;
1111  SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item);
1112  item_data = (TV_ITEMDATA *)item.lParam;
1113 
1114  hr = IShellFolder_CompareIDs(item_data->lpsfParent, 0, item_data->lpifq, pidl);
1115  if(SUCCEEDED(hr) && !HRESULT_CODE(hr))
1116  return hItem;
1117 
1119 
1120  while (hItem)
1121  {
1122  HTREEITEM newItem = BrsFolder_FindItemByPidl(info, pidl, hItem);
1123  if (newItem)
1124  return newItem;
1126  }
1127  return NULL;
1128 }
1129 
1131 {
1132  BOOL ret = TRUE;
1133 
1134  TRACE("(%p)->(%p, %p, 0x%08x)\n", info, pidls[0], pidls[1], event);
1135 
1136  switch (event)
1137  {
1138  case SHCNE_RMDIR:
1139  case SHCNE_DELETE:
1140  {
1141  HTREEITEM handle_root = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_ROOT, 0);
1142  HTREEITEM handle_item = BrsFolder_FindItemByPidl(info, pidls[0], handle_root);
1143 
1144  if (handle_item)
1145  SendMessageW(info->hwndTreeView, TVM_DELETEITEM, 0, (LPARAM)handle_item);
1146 
1147  break;
1148  }
1149  }
1150  return ret;
1151 }
1152 
1153 /*************************************************************************
1154  * BrsFolderDlgProc32 (not an exported API function)
1155  */
1157  LPARAM lParam )
1158 {
1159  browse_info *info;
1160 
1161  TRACE("hwnd=%p msg=%04x 0x%08lx 0x%08lx\n", hWnd, msg, wParam, lParam );
1162 
1163  if (msg == WM_INITDIALOG)
1164  return BrsFolder_OnCreate( hWnd, (browse_info*) lParam );
1165 
1167 
1168  switch (msg)
1169  {
1170  case WM_NOTIFY:
1172 
1173  case WM_COMMAND:
1174  return BrsFolder_OnCommand( info, wParam );
1175 
1176  case WM_WINDOWPOSCHANGING:
1178 
1179  case WM_SIZE:
1180  if (info->layout) /* new style dialogs */
1182  return 0;
1183 
1184  case BFFM_SETSTATUSTEXTA:
1185  TRACE("Set status %s\n", debugstr_a((LPSTR)lParam));
1187  break;
1188 
1189  case BFFM_SETSTATUSTEXTW:
1190  TRACE("Set status %s\n", debugstr_w((LPWSTR)lParam));
1192  break;
1193 
1194  case BFFM_ENABLEOK:
1195  TRACE("Enable %ld\n", lParam);
1196  EnableWindow(GetDlgItem(hWnd, 1), lParam != 0);
1197  break;
1198 
1199  case BFFM_SETOKTEXT: /* unicode only */
1200  TRACE("Set OK text %s\n", debugstr_w((LPWSTR)lParam));
1202  break;
1203 
1204  case BFFM_SETSELECTIONA:
1206 
1207  case BFFM_SETSELECTIONW:
1209 
1210  case BFFM_SETEXPANDED: /* unicode only */
1212 
1213  case SHV_CHANGE_NOTIFY:
1215 
1216  case WM_DESTROY:
1217  return BrsFolder_OnDestroy(info);
1218  }
1219  return FALSE;
1220 }
1221 
1222 #ifndef __REACTOS__
1223 static const WCHAR swBrowseTemplateName[] = {
1224  'S','H','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0};
1225 static const WCHAR swNewBrowseTemplateName[] = {
1226  'S','H','N','E','W','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0};
1227 #endif
1228 
1229 /*************************************************************************
1230  * SHBrowseForFolderA [SHELL32.@]
1231  * SHBrowseForFolder [SHELL32.@]
1232  */
1234 {
1235  BROWSEINFOW bi;
1236  LPITEMIDLIST lpid;
1237  INT len;
1238  LPWSTR title;
1239 
1240  TRACE("%p\n", lpbi);
1241 
1242  bi.hwndOwner = lpbi->hwndOwner;
1243  bi.pidlRoot = lpbi->pidlRoot;
1244  if (lpbi->pszDisplayName)
1245  bi.pszDisplayName = HeapAlloc( GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR) );
1246  else
1247  bi.pszDisplayName = NULL;
1248 
1249  if (lpbi->lpszTitle)
1250  {
1251  len = MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, NULL, 0 );
1252  title = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
1253  MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, title, len );
1254  }
1255  else
1256  title = NULL;
1257 
1258  bi.lpszTitle = title;
1259  bi.ulFlags = lpbi->ulFlags;
1260  bi.lpfn = lpbi->lpfn;
1261  bi.lParam = lpbi->lParam;
1262  bi.iImage = lpbi->iImage;
1263  lpid = SHBrowseForFolderW( &bi );
1264  if (bi.pszDisplayName)
1265  {
1267  lpbi->pszDisplayName, MAX_PATH, 0, NULL);
1269  }
1270  HeapFree(GetProcessHeap(), 0, title);
1271  lpbi->iImage = bi.iImage;
1272  return lpid;
1273 }
1274 
1275 
1276 /*************************************************************************
1277  * SHBrowseForFolderW [SHELL32.@]
1278  *
1279  * NOTES
1280  * crashes when passed a null pointer
1281  */
1283 {
1284  browse_info info;
1285  DWORD r;
1286  HRESULT hr;
1287 #ifdef __REACTOS__
1288  WORD wDlgId;
1289 #else
1290  const WCHAR * templateName;
1291  INITCOMMONCONTROLSEX icex;
1292 #endif
1293 
1294  info.hWnd = 0;
1295  info.pidlRet = NULL;
1296  info.lpBrowseInfo = lpbi;
1297  info.hwndTreeView = NULL;
1298 
1299 #ifndef __REACTOS__
1300  icex.dwSize = sizeof( icex );
1301  icex.dwICC = ICC_TREEVIEW_CLASSES;
1302  InitCommonControlsEx( &icex );
1303 #endif
1304 
1305  hr = OleInitialize(NULL);
1306 
1307  if (lpbi->ulFlags & BIF_NEWDIALOGSTYLE)
1308  wDlgId = IDD_BROWSE_FOR_FOLDER_NEW;
1309  else
1310  wDlgId = IDD_BROWSE_FOR_FOLDER;
1313  if (SUCCEEDED(hr))
1314  OleUninitialize();
1315  if (!r)
1316  {
1317  ILFree(info.pidlRet);
1318  return NULL;
1319  }
1320 
1321  return info.pidlRet;
1322 }
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
ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, int fSources, LONG wEventMask, UINT uMsg, int cItems, SHChangeNotifyEntry *lpItems)
Definition: changenotify.c:215
#define IDC_BROWSE_FOR_FOLDER_FOLDER_TEXT
Definition: shresdef.h:377
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDC_BROWSE_FOR_FOLDER_STATUS
Definition: shresdef.h:379
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:1058
#define TRUE
Definition: types.h:120
#define SHCNE_RMDIR
Definition: shlobj.h:1732
#define IDOK
Definition: winuser.h:824
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
HTREEITEM hParent
Definition: commctrl.h:3389
LPITEMIDLIST _ILCreateDesktop(void)
Definition: pidl.c:1588
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:1906
#define CSIDL_DESKTOP
Definition: shlobj.h:2011
#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:111
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:1158
static LRESULT BrsFolder_OnChange(browse_info *info, const LPCITEMIDLIST *pidls, LONG event)
Definition: brsfolder.c:1130
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1280
#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:1162
LONG top
Definition: windef.h:307
LAYOUT_DATA * layout
Definition: brsfolder.c:59
HWND hwndOwner
Definition: shlobj.h:1126
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define HWND_TOP
Definition: winuser.h:1193
#define BFFM_SETSELECTIONA
Definition: shlobj.h:1171
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT_PTR WPARAM
Definition: windef.h:207
#define BIF_NONEWFOLDERBUTTON
Definition: shlobj.h:1153
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:212
#define TVIS_EXPANDEDONCE
Definition: commctrl.h:3281
#define BIF_EDITBOX
Definition: shlobj.h:1147
#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
LONG right
Definition: windef.h:308
#define E_FAIL
Definition: ddrawi.h:102
struct tagLAYOUT_INFO LAYOUT_INFO
LPWSTR pszText
Definition: commctrl.h:3316
BFFCALLBACK lpfn
Definition: shlobj.h:1120
#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
static BOOLEAN bSuccess
Definition: drive.cpp:419
#define BFFM_SETEXPANDED
Definition: shlobj.h:1175
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:380
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:682
LPSTR pszDisplayName
Definition: shlobj.h:1117
#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:1752
long LONG
Definition: pedump.c:60
LPWSTR pszDisplayName
Definition: shlobj.h:1128
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:110
BOOL WINAPI MoveFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName)
Definition: move.c:1044
#define BIF_RETURNFSANCESTORS
Definition: shlobj.h:1146
#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:1773
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:1172
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:1046
LPSHELLFOLDER lpsfParent
Definition: brsfolder.c:66
#define IDD_BROWSE_FOR_FOLDER
Definition: shresdef.h:374
#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:378
#define VK_DELETE
Definition: winuser.h:2208
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
static const WCHAR swNewBrowseTemplateName[]
Definition: brsfolder.c:1225
#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:1129
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:1145
#define BIF_NEWDIALOGSTYLE
Definition: shlobj.h:1149
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
r parent
Definition: btrfs.c:2869
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:1111
__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:964
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
#define _countof(array)
Definition: sndvol32.h:68
#define TVN_ENDLABELEDITA
Definition: commctrl.h:3707
LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi)
Definition: brsfolder.c:1233
#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:1116
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:1118
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:803
_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:1077
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
PCIDLIST_ABSOLUTE pidl
Definition: shlobj.h:1724
#define WM_COMMAND
Definition: winuser.h:1722
struct _cl_event * event
Definition: glext.h:7739
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1127
#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:375
static LRESULT BrsFolder_Treeview_Keydown(browse_info *info, LPNMTVKEYDOWN keydown)
Definition: brsfolder.c:628
UINT ulFlags
Definition: shlobj.h:1119
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:1282
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
#define SWP_NOSIZE
Definition: winuser.h:1230
#define ERR(fmt,...)
Definition: debug.h:109
#define TVM_GETNEXTITEM
Definition: commctrl.h:3445
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define BFFM_ENABLEOK
Definition: shlobj.h:1170
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:1121
#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:1130
static INT BrsFolder_OnDestroy(browse_info *info)
Definition: brsfolder.c:1089
static ATOM item
Definition: dde.c:856
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1143
LPARAM lParam
Definition: shlobj.h:1132
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:934
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define SHCNE_DELETE
Definition: shlobj.h:1730
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:1163
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:1169
BFFCALLBACK lpfn
Definition: shlobj.h:1131
#define TVIF_IMAGE
Definition: commctrl.h:3263
#define SUPPORTEDFLAGS
Definition: brsfolder.c:93
#define IDC_BROWSE_FOR_FOLDER_TREEVIEW
Definition: shresdef.h:381
#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:721
static const WCHAR swBrowseTemplateName[]
Definition: brsfolder.c:1223
#define MultiByteToWideChar
Definition: compat.h:100
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
Definition: changenotify.c:283
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2888
#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
unsigned int ULONG
Definition: retypes.h:1
static HTREEITEM BrsFolder_FindItemByPidl(browse_info *info, LPCITEMIDLIST pidl, HTREEITEM hItem)
Definition: brsfolder.c:1103
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:1174
#define TVIF_PARAM
Definition: commctrl.h:3264
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2026
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:1156
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:1115
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:1173
#define BIF_BROWSEFORCOMPUTER
Definition: shlobj.h:1156
#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:402
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:84
#define IDC_BROWSE_FOR_FOLDER_NEW_FOLDER
Definition: shresdef.h:376
#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