2002-03-09 23:29:33 +00:00
|
|
|
/*
|
|
|
|
* Copyright 1999 Juergen Schmied
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2002-07-24 01:56:03 +00:00
|
|
|
*
|
|
|
|
* FIXME:
|
|
|
|
* - view with root unequal desktop
|
|
|
|
* - many memory leaks
|
|
|
|
* - show only filesystem objects
|
2002-03-09 23:29:33 +00:00
|
|
|
*/
|
|
|
|
|
1999-01-26 10:30:55 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
#include "wine/debug.h"
|
2001-08-16 18:49:56 +00:00
|
|
|
#include "undocshell.h"
|
2000-08-25 21:33:23 +00:00
|
|
|
#include "shlguid.h"
|
1999-01-26 10:30:55 +00:00
|
|
|
#include "pidl.h"
|
|
|
|
#include "shell32_main.h"
|
1999-04-22 10:11:04 +00:00
|
|
|
#include "shellapi.h"
|
2000-08-25 21:33:23 +00:00
|
|
|
#include "shresdef.h"
|
1999-01-26 10:30:55 +00:00
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
1999-01-26 10:30:55 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
static HWND hwndTreeView;
|
2000-08-25 21:33:23 +00:00
|
|
|
static LPBROWSEINFOA lpBrowseInfo;
|
1999-01-26 10:30:55 +00:00
|
|
|
static LPITEMIDLIST pidlRet;
|
|
|
|
|
|
|
|
static void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST lpifq, HTREEITEM hParent);
|
|
|
|
|
2000-08-25 21:33:23 +00:00
|
|
|
static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root)
|
1999-01-26 10:30:55 +00:00
|
|
|
{
|
|
|
|
HIMAGELIST hImageList;
|
1999-03-14 12:16:21 +00:00
|
|
|
IShellFolder * lpsf;
|
1999-01-26 10:30:55 +00:00
|
|
|
HRESULT hr;
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
hwndTreeView = GetDlgItem (hwndParent, IDD_TREEVIEW);
|
1999-01-26 10:30:55 +00:00
|
|
|
Shell_GetImageList(NULL, &hImageList);
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2002-11-21 23:56:42 +00:00
|
|
|
TRACE("dlg=%p tree=%p\n", hwndParent, hwndTreeView );
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
if (hImageList && hwndTreeView)
|
|
|
|
{ TreeView_SetImageList(hwndTreeView, hImageList, 0);
|
|
|
|
}
|
|
|
|
|
2000-08-25 21:33:23 +00:00
|
|
|
/* so far, this method doesn't work (still missing the upper level), keep the old way */
|
|
|
|
#if 0
|
2002-07-24 01:56:03 +00:00
|
|
|
if (_ILIsDesktop (root)) {
|
2000-08-25 21:33:23 +00:00
|
|
|
hr = SHGetDesktopFolder(&lpsf);
|
|
|
|
} else {
|
|
|
|
IShellFolder * lpsfdesktop;
|
|
|
|
|
|
|
|
hr = SHGetDesktopFolder(&lpsfdesktop);
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
hr = IShellFolder_BindToObject(lpsfdesktop, root, 0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf);
|
|
|
|
IShellFolder_Release(lpsfdesktop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
1999-03-14 12:16:21 +00:00
|
|
|
hr = SHGetDesktopFolder(&lpsf);
|
2000-08-25 21:33:23 +00:00
|
|
|
#endif
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
if (SUCCEEDED(hr) && hwndTreeView)
|
|
|
|
{ TreeView_DeleteAllItems(hwndTreeView);
|
|
|
|
FillTreeView(lpsf, NULL, TVI_ROOT);
|
|
|
|
}
|
2002-05-31 23:06:46 +00:00
|
|
|
|
1999-01-26 10:30:55 +00:00
|
|
|
if (SUCCEEDED(hr))
|
1999-03-14 12:16:21 +00:00
|
|
|
{ IShellFolder_Release(lpsf);
|
1999-01-26 10:30:55 +00:00
|
|
|
}
|
2000-08-25 21:33:23 +00:00
|
|
|
TRACE("done\n");
|
1999-01-26 10:30:55 +00:00
|
|
|
}
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
static int GetIcon(LPITEMIDLIST lpi, UINT uFlags)
|
|
|
|
{ SHFILEINFOA sfi;
|
|
|
|
SHGetFileInfoA((LPCSTR)lpi,0,&sfi, sizeof(SHFILEINFOA), uFlags);
|
1999-01-26 10:30:55 +00:00
|
|
|
return sfi.iIcon;
|
|
|
|
}
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTVITEMA lpTV_ITEM)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("%p %p\n",lpifq, lpTV_ITEM);
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
lpTV_ITEM->iImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
|
|
|
|
lpTV_ITEM->iSelectedImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct tagID
|
|
|
|
{
|
|
|
|
LPSHELLFOLDER lpsfParent;
|
|
|
|
LPITEMIDLIST lpi;
|
|
|
|
LPITEMIDLIST lpifq;
|
|
|
|
} TV_ITEMDATA, *LPTV_ITEMDATA;
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
static BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPSTR lpFriendlyName)
|
1999-01-26 10:30:55 +00:00
|
|
|
{
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL bSuccess=TRUE;
|
1999-01-26 10:30:55 +00:00
|
|
|
STRRET str;
|
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%p %p %lx %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
|
1999-03-14 12:16:21 +00:00
|
|
|
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str)))
|
1999-07-28 16:38:45 +00:00
|
|
|
{
|
1999-09-03 12:38:02 +00:00
|
|
|
if(FAILED(StrRetToStrNA (lpFriendlyName, MAX_PATH, &str, lpi)))
|
|
|
|
{
|
|
|
|
bSuccess = FALSE;
|
|
|
|
}
|
1999-01-26 10:30:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
bSuccess = FALSE;
|
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("-- %s\n",lpFriendlyName);
|
1999-01-26 10:30:55 +00:00
|
|
|
return bSuccess;
|
|
|
|
}
|
|
|
|
|
1999-03-14 12:16:21 +00:00
|
|
|
static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hParent)
|
1999-01-26 10:30:55 +00:00
|
|
|
{
|
1999-03-14 12:16:21 +00:00
|
|
|
TVITEMA tvi;
|
|
|
|
TVINSERTSTRUCTA tvins;
|
|
|
|
HTREEITEM hPrev = 0;
|
|
|
|
LPENUMIDLIST lpe=0;
|
1999-01-26 10:30:55 +00:00
|
|
|
LPITEMIDLIST pidlTemp=0;
|
|
|
|
LPTV_ITEMDATA lptvid=0;
|
|
|
|
ULONG ulFetched;
|
|
|
|
HRESULT hr;
|
|
|
|
char szBuff[256];
|
1999-02-26 11:11:13 +00:00
|
|
|
HWND hwnd=GetParent(hwndTreeView);
|
1999-01-26 10:30:55 +00:00
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%p %p %x\n",lpsf, pidl, (INT)hParent);
|
1999-02-26 11:11:13 +00:00
|
|
|
SetCapture(GetParent(hwndTreeView));
|
|
|
|
SetCursor(LoadCursorA(0, IDC_WAITA));
|
1999-01-26 10:30:55 +00:00
|
|
|
|
1999-03-14 12:16:21 +00:00
|
|
|
hr=IShellFolder_EnumObjects(lpsf,hwnd, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,&lpe);
|
1999-01-26 10:30:55 +00:00
|
|
|
|
1999-04-01 10:24:21 +00:00
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{ while (NOERROR == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched))
|
|
|
|
{ ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
|
|
|
|
IShellFolder_GetAttributesOf(lpsf, 1, &pidlTemp, &ulAttrs);
|
|
|
|
if (ulAttrs & (SFGAO_HASSUBFOLDER | SFGAO_FOLDER))
|
|
|
|
{ if (ulAttrs & SFGAO_FOLDER)
|
|
|
|
{ tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
if (ulAttrs & SFGAO_HASSUBFOLDER)
|
|
|
|
{ tvi.cChildren=1;
|
|
|
|
tvi.mask |= TVIF_CHILDREN;
|
|
|
|
}
|
|
|
|
|
1999-09-03 12:38:02 +00:00
|
|
|
if (!( lptvid = (LPTV_ITEMDATA)SHAlloc(sizeof(TV_ITEMDATA))))
|
|
|
|
goto Done;
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
if (!GetName(lpsf, pidlTemp, SHGDN_NORMAL, szBuff))
|
1999-09-03 12:38:02 +00:00
|
|
|
goto Done;
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
tvi.pszText = szBuff;
|
|
|
|
tvi.cchTextMax = MAX_PATH;
|
|
|
|
tvi.lParam = (LPARAM)lptvid;
|
|
|
|
|
1999-03-14 12:16:21 +00:00
|
|
|
IShellFolder_AddRef(lpsf);
|
1999-01-26 10:30:55 +00:00
|
|
|
lptvid->lpsfParent = lpsf;
|
|
|
|
lptvid->lpi = ILClone(pidlTemp);
|
|
|
|
lptvid->lpifq = ILCombine(pidl, pidlTemp);
|
|
|
|
GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
|
|
|
|
|
1999-01-30 13:02:30 +00:00
|
|
|
tvins.DUMMYUNIONNAME.item = tvi;
|
1999-01-26 10:30:55 +00:00
|
|
|
tvins.hInsertAfter = hPrev;
|
|
|
|
tvins.hParent = hParent;
|
|
|
|
|
1999-09-03 12:38:02 +00:00
|
|
|
hPrev = (HTREEITEM)TreeView_InsertItemA (hwndTreeView, &tvins);
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
1999-04-22 16:27:50 +00:00
|
|
|
SHFree(pidlTemp); /* Finally, free the pidl that the shell gave us... */
|
1999-01-26 10:30:55 +00:00
|
|
|
pidlTemp=0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Done:
|
|
|
|
ReleaseCapture();
|
1999-02-26 11:11:13 +00:00
|
|
|
SetCursor(LoadCursorA(0, IDC_ARROWA));
|
1999-01-26 10:30:55 +00:00
|
|
|
|
1999-03-14 12:16:21 +00:00
|
|
|
if (lpe)
|
1999-10-13 14:01:40 +00:00
|
|
|
IEnumIDList_Release(lpe);
|
1999-03-14 12:16:21 +00:00
|
|
|
if (pidlTemp )
|
|
|
|
SHFree(pidlTemp);
|
1999-01-26 10:30:55 +00:00
|
|
|
}
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh)
|
2002-05-31 23:06:46 +00:00
|
|
|
{
|
1999-02-26 11:11:13 +00:00
|
|
|
NMTREEVIEWA *pnmtv = (NMTREEVIEWA *)lpnmh;
|
1999-04-22 16:27:50 +00:00
|
|
|
LPTV_ITEMDATA lptvid; /* Long pointer to TreeView item data */
|
1999-03-14 12:16:21 +00:00
|
|
|
IShellFolder * lpsf2=0;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
1999-01-26 10:30:55 +00:00
|
|
|
|
2002-11-21 23:56:42 +00:00
|
|
|
TRACE("%p %x %p msg=%x\n", hWnd, CtlID, lpnmh, pnmtv->hdr.code);
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
switch (pnmtv->hdr.idFrom)
|
|
|
|
{ case IDD_TREEVIEW:
|
2002-05-31 23:06:46 +00:00
|
|
|
switch (pnmtv->hdr.code)
|
2002-04-20 20:52:33 +00:00
|
|
|
{ case TVN_DELETEITEMA: case TVN_DELETEITEMW:
|
|
|
|
{ FIXME("TVN_DELETEITEMA/W\n");
|
1999-01-26 10:30:55 +00:00
|
|
|
lptvid=(LPTV_ITEMDATA)pnmtv->itemOld.lParam;
|
1999-03-14 12:16:21 +00:00
|
|
|
IShellFolder_Release(lptvid->lpsfParent);
|
2002-05-31 23:06:46 +00:00
|
|
|
SHFree(lptvid->lpi);
|
|
|
|
SHFree(lptvid->lpifq);
|
|
|
|
SHFree(lptvid);
|
1999-01-26 10:30:55 +00:00
|
|
|
}
|
|
|
|
break;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2002-04-20 20:52:33 +00:00
|
|
|
case TVN_ITEMEXPANDINGA: case TVN_ITEMEXPANDINGW:
|
|
|
|
{ FIXME("TVN_ITEMEXPANDINGA/W\n");
|
1999-01-26 10:30:55 +00:00
|
|
|
if ((pnmtv->itemNew.state & TVIS_EXPANDEDONCE))
|
|
|
|
break;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
1999-01-26 10:30:55 +00:00
|
|
|
lptvid=(LPTV_ITEMDATA)pnmtv->itemNew.lParam;
|
1999-03-14 12:16:21 +00:00
|
|
|
if (SUCCEEDED(IShellFolder_BindToObject(lptvid->lpsfParent, lptvid->lpi,0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf2)))
|
1999-01-26 10:30:55 +00:00
|
|
|
{ FillTreeView( lpsf2, lptvid->lpifq, pnmtv->itemNew.hItem );
|
|
|
|
}
|
|
|
|
TreeView_SortChildren(hwndTreeView, pnmtv->itemNew.hItem, FALSE);
|
|
|
|
}
|
|
|
|
break;
|
2002-04-20 20:52:33 +00:00
|
|
|
case TVN_SELCHANGEDA: case TVN_SELCHANGEDW:
|
1999-01-26 10:30:55 +00:00
|
|
|
lptvid=(LPTV_ITEMDATA)pnmtv->itemNew.lParam;
|
|
|
|
pidlRet = lptvid->lpifq;
|
2000-08-25 21:33:23 +00:00
|
|
|
if (lpBrowseInfo->lpfn)
|
|
|
|
(lpBrowseInfo->lpfn)(hWnd, BFFM_SELCHANGED, (LPARAM)pidlRet, lpBrowseInfo->lParam);
|
1999-01-26 10:30:55 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2000-08-25 21:33:23 +00:00
|
|
|
FIXME("unhandled (%d)\n", pnmtv->hdr.code);
|
1999-01-26 10:30:55 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* BrsFolderDlgProc32 (not an exported API function)
|
|
|
|
*/
|
2002-10-31 01:04:39 +00:00
|
|
|
static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
|
1999-07-31 14:41:43 +00:00
|
|
|
LPARAM lParam )
|
2002-08-14 21:03:55 +00:00
|
|
|
{
|
2002-11-21 23:56:42 +00:00
|
|
|
TRACE("hwnd=%p msg=%04x 0x%08x 0x%08lx\n", hWnd, msg, wParam, lParam );
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
switch(msg)
|
|
|
|
{ case WM_INITDIALOG:
|
|
|
|
pidlRet = NULL;
|
1999-02-26 11:11:13 +00:00
|
|
|
lpBrowseInfo = (LPBROWSEINFOA) lParam;
|
2000-08-25 21:33:23 +00:00
|
|
|
if (lpBrowseInfo->ulFlags & ~(BIF_STATUSTEXT))
|
|
|
|
FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~(BIF_STATUSTEXT));
|
|
|
|
if (lpBrowseInfo->lpszTitle) {
|
|
|
|
SetWindowTextA(GetDlgItem(hWnd, IDD_TITLE), lpBrowseInfo->lpszTitle);
|
|
|
|
} else {
|
|
|
|
ShowWindow(GetDlgItem(hWnd, IDD_TITLE), SW_HIDE);
|
|
|
|
}
|
|
|
|
if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT))
|
|
|
|
ShowWindow(GetDlgItem(hWnd, IDD_STATUS), SW_HIDE);
|
|
|
|
|
1999-01-26 10:30:55 +00:00
|
|
|
if ( lpBrowseInfo->pidlRoot )
|
1999-06-12 15:45:58 +00:00
|
|
|
FIXME("root is desktop\n");
|
1999-01-26 10:30:55 +00:00
|
|
|
|
2000-08-25 21:33:23 +00:00
|
|
|
InitializeTreeView( hWnd, lpBrowseInfo->pidlRoot );
|
|
|
|
|
|
|
|
if (lpBrowseInfo->lpfn) {
|
|
|
|
(lpBrowseInfo->lpfn)(hWnd, BFFM_INITIALIZED, 0, lpBrowseInfo->lParam);
|
|
|
|
(lpBrowseInfo->lpfn)(hWnd, BFFM_SELCHANGED, 0/*FIXME*/, lpBrowseInfo->lParam);
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
1999-01-26 10:30:55 +00:00
|
|
|
|
|
|
|
case WM_NOTIFY:
|
1999-02-26 11:11:13 +00:00
|
|
|
MsgNotify( hWnd, (UINT)wParam, (LPNMHDR)lParam);
|
1999-01-26 10:30:55 +00:00
|
|
|
break;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
1999-01-26 10:30:55 +00:00
|
|
|
case WM_COMMAND:
|
|
|
|
switch (wParam)
|
|
|
|
{ case IDOK:
|
|
|
|
pdump ( pidlRet );
|
1999-07-25 12:26:05 +00:00
|
|
|
SHGetPathFromIDListA(pidlRet, lpBrowseInfo->pszDisplayName);
|
1999-02-26 11:11:13 +00:00
|
|
|
EndDialog(hWnd, (DWORD) ILClone(pidlRet));
|
1999-01-26 10:30:55 +00:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
case IDCANCEL:
|
1999-02-26 11:11:13 +00:00
|
|
|
EndDialog(hWnd, 0);
|
1999-01-26 10:30:55 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
2000-08-25 21:33:23 +00:00
|
|
|
case BFFM_SETSTATUSTEXTA:
|
|
|
|
TRACE("Set status %s\n", debugstr_a((LPSTR)lParam));
|
|
|
|
SetWindowTextA(GetDlgItem(hWnd, IDD_STATUS), (LPSTR)lParam);
|
|
|
|
break;
|
|
|
|
case BFFM_SETSTATUSTEXTW:
|
|
|
|
TRACE("Set status %s\n", debugstr_w((LPWSTR)lParam));
|
|
|
|
SetWindowTextW(GetDlgItem(hWnd, IDD_STATUS), (LPWSTR)lParam);
|
|
|
|
break;
|
|
|
|
case BFFM_ENABLEOK:
|
|
|
|
TRACE("Enable %ld\n", lParam);
|
|
|
|
EnableWindow(GetDlgItem(hWnd, 1), (lParam)?TRUE:FALSE);
|
|
|
|
break;
|
|
|
|
case BFFM_SETSELECTIONA:
|
|
|
|
if (wParam)
|
|
|
|
TRACE("Set selection %s\n", debugstr_a((LPSTR)lParam));
|
|
|
|
else
|
|
|
|
TRACE("Set selection %p\n", (void*)lParam);
|
|
|
|
break;
|
|
|
|
case BFFM_SETSELECTIONW:
|
|
|
|
if (wParam)
|
|
|
|
TRACE("Set selection %s\n", debugstr_w((LPWSTR)lParam));
|
|
|
|
else
|
|
|
|
TRACE("Set selection %p\n", (void*)lParam);
|
|
|
|
break;
|
1999-01-26 10:30:55 +00:00
|
|
|
}
|
2000-08-25 21:33:23 +00:00
|
|
|
return FALSE;
|
1999-01-26 10:30:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-06-19 18:20:47 +00:00
|
|
|
* SHBrowseForFolderA [SHELL32.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* SHBrowseForFolder [SHELL32.@]
|
1999-01-26 10:30:55 +00:00
|
|
|
*
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi)
|
1999-01-26 10:30:55 +00:00
|
|
|
{
|
2002-11-21 23:56:42 +00:00
|
|
|
TRACE("(%p{lpszTitle=%s,owner=%p})\n",
|
2000-08-25 21:33:23 +00:00
|
|
|
lpbi, debugstr_a(lpbi->lpszTitle), lpbi->hwndOwner);
|
1999-01-26 10:30:55 +00:00
|
|
|
|
1999-04-25 18:31:35 +00:00
|
|
|
return (LPITEMIDLIST) DialogBoxParamA( shell32_hInstance,
|
2002-05-31 23:06:46 +00:00
|
|
|
"SHBRSFORFOLDER_MSGBOX",
|
2000-08-25 21:33:23 +00:00
|
|
|
lpbi->hwndOwner,
|
|
|
|
BrsFolderDlgProc, (INT)lpbi );
|
1999-01-26 10:30:55 +00:00
|
|
|
}
|
2002-07-19 00:26:02 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SHBrowseForFolderW [SHELL32.@]
|
|
|
|
*/
|
|
|
|
LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi)
|
|
|
|
{
|
|
|
|
char szDisplayName[MAX_PATH], szTitle[MAX_PATH];
|
|
|
|
BROWSEINFOA bi;
|
|
|
|
|
2002-11-21 23:56:42 +00:00
|
|
|
TRACE("((%p->{lpszTitle=%s,owner=%p})\n", lpbi,
|
2002-07-19 00:26:02 +00:00
|
|
|
lpbi ? debugstr_w(lpbi->lpszTitle): NULL, lpbi ? lpbi->hwndOwner: 0);
|
|
|
|
|
|
|
|
if (!lpbi)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
bi.hwndOwner = lpbi->hwndOwner;
|
|
|
|
bi.pidlRoot = lpbi->pidlRoot;
|
|
|
|
if (lpbi->pszDisplayName)
|
|
|
|
{
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, lpbi->pszDisplayName, -1, szDisplayName, MAX_PATH, 0, NULL);
|
|
|
|
bi.pszDisplayName = szDisplayName;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bi.pszDisplayName = NULL;
|
|
|
|
|
|
|
|
if (lpbi->lpszTitle)
|
|
|
|
{
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, lpbi->lpszTitle, -1, szTitle, MAX_PATH, 0, NULL);
|
|
|
|
bi.lpszTitle = szTitle;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bi.lpszTitle = NULL;
|
|
|
|
|
|
|
|
bi.ulFlags = lpbi->ulFlags;
|
|
|
|
bi.lpfn = lpbi->lpfn;
|
|
|
|
bi.lParam = lpbi->lParam;
|
|
|
|
bi.iImage = lpbi->iImage;
|
|
|
|
return (LPITEMIDLIST) DialogBoxParamA(shell32_hInstance,
|
|
|
|
"SHBRSFORFOLDER_MSGBOX", lpbi->hwndOwner,
|
|
|
|
BrsFolderDlgProc, (INT)lpbi);
|
|
|
|
}
|