Commit 7aae1b79 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

- Support a few more flags

- Rewrite the enumeration loop - Support non-desktop root - Silence harmless and implemented debug messages
parent 7731c8e3
...@@ -16,9 +16,8 @@ ...@@ -16,9 +16,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* FIXME: * FIXME:
* - view with root unequal desktop
* - many memory leaks * - many memory leaks
* - show only filesystem objects * - many flags unimplemented
*/ */
#include <stdlib.h> #include <stdlib.h>
...@@ -40,13 +39,29 @@ static HWND hwndTreeView; ...@@ -40,13 +39,29 @@ static HWND hwndTreeView;
static LPBROWSEINFOW lpBrowseInfo; static LPBROWSEINFOW lpBrowseInfo;
static LPITEMIDLIST pidlRet; static LPITEMIDLIST pidlRet;
static void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST lpifq, HTREEITEM hParent); static void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST lpifq, HTREEITEM hParent, IEnumIDList* lpe);
static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPITEMIDLIST pidl, LPITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent);
#define SUPPORTEDFLAGS (BIF_STATUSTEXT | \
BIF_BROWSEFORCOMPUTER | \
BIF_RETURNFSANCESTORS | \
BIF_RETURNONLYFSDIRS | \
BIF_BROWSEINCLUDEFILES)
static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
{
return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0);
}
static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root) static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root)
{ {
HIMAGELIST hImageList; HIMAGELIST hImageList;
IShellFolder * lpsf; IShellFolder * lpsf;
HRESULT hr; HRESULT hr;
IEnumIDList * pEnumIL = NULL;
LPITEMIDLIST parentofroot;
parentofroot = ILClone(root);
ILRemoveLastID(parentofroot);
hwndTreeView = GetDlgItem (hwndParent, IDD_TREEVIEW); hwndTreeView = GetDlgItem (hwndParent, IDD_TREEVIEW);
Shell_GetImageList(NULL, &hImageList); Shell_GetImageList(NULL, &hImageList);
...@@ -54,11 +69,8 @@ static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root) ...@@ -54,11 +69,8 @@ static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root)
TRACE("dlg=%p tree=%p\n", hwndParent, hwndTreeView ); TRACE("dlg=%p tree=%p\n", hwndParent, hwndTreeView );
if (hImageList && hwndTreeView) if (hImageList && hwndTreeView)
{ TreeView_SetImageList(hwndTreeView, hImageList, 0); TreeView_SetImageList(hwndTreeView, hImageList, 0);
}
/* so far, this method doesn't work (still missing the upper level), keep the old way */
#if 0
if (_ILIsDesktop (root)) { if (_ILIsDesktop (root)) {
hr = SHGetDesktopFolder(&lpsf); hr = SHGetDesktopFolder(&lpsf);
} else { } else {
...@@ -66,37 +78,70 @@ static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root) ...@@ -66,37 +78,70 @@ static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root)
hr = SHGetDesktopFolder(&lpsfdesktop); hr = SHGetDesktopFolder(&lpsfdesktop);
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
hr = IShellFolder_BindToObject(lpsfdesktop, root, 0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf); hr = IShellFolder_BindToObject(lpsfdesktop, parentofroot, 0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf);
IShellFolder_Release(lpsfdesktop); IShellFolder_Release(lpsfdesktop);
} }
} }
#else if (SUCCEEDED(hr))
hr = SHGetDesktopFolder(&lpsf); {
#endif IShellFolder * pSFRoot;
if (_ILIsPidlSimple(root))
{
pSFRoot = lpsf;
IShellFolder_AddRef(pSFRoot);
}
else
hr = IShellFolder_BindToObject(lpsf,ILFindLastID(root),0,&IID_IShellFolder,(LPVOID *)&pSFRoot);
if (SUCCEEDED(hr))
{
hr = IShellFolder_EnumObjects(
pSFRoot,
hwndParent,
BrowseFlagsToSHCONTF(lpBrowseInfo->ulFlags),
&pEnumIL);
IShellFolder_Release(pSFRoot);
}
}
if (SUCCEEDED(hr) && hwndTreeView) if (SUCCEEDED(hr) && hwndTreeView)
{ TreeView_DeleteAllItems(hwndTreeView); {
FillTreeView(lpsf, NULL, TVI_ROOT); TreeView_DeleteAllItems(hwndTreeView);
TreeView_Expand(hwndTreeView,
InsertTreeViewItem(lpsf, _ILIsPidlSimple(root) ? root : ILFindLastID(root), parentofroot, pEnumIL, TVI_ROOT),
TVE_EXPAND);
} }
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ IShellFolder_Release(lpsf); IShellFolder_Release(lpsf);
}
TRACE("done\n"); TRACE("done\n");
} }
static int GetIcon(LPITEMIDLIST lpi, UINT uFlags) static int GetIcon(LPITEMIDLIST lpi, UINT uFlags)
{ SHFILEINFOW sfi; {
SHFILEINFOW sfi;
SHGetFileInfoW((LPCWSTR)lpi, 0 ,&sfi, sizeof(SHFILEINFOW), uFlags); SHGetFileInfoW((LPCWSTR)lpi, 0 ,&sfi, sizeof(SHFILEINFOW), uFlags);
return sfi.iIcon; return sfi.iIcon;
} }
static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM) static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM)
{ TRACE("%p %p\n",lpifq, lpTV_ITEM); {
LPITEMIDLIST pidlDesktop = NULL;
TRACE("%p %p\n",lpifq, lpTV_ITEM);
if (!lpifq)
{
pidlDesktop = _ILCreateDesktop();
lpifq = pidlDesktop;
}
lpTV_ITEM->iImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON); lpTV_ITEM->iImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
lpTV_ITEM->iSelectedImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON); lpTV_ITEM->iSelectedImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON);
if (pidlDesktop)
ILFree(pidlDesktop);
return; return;
} }
...@@ -105,6 +150,7 @@ typedef struct tagID ...@@ -105,6 +150,7 @@ typedef struct tagID
LPSHELLFOLDER lpsfParent; LPSHELLFOLDER lpsfParent;
LPITEMIDLIST lpi; LPITEMIDLIST lpi;
LPITEMIDLIST lpifq; LPITEMIDLIST lpifq;
IEnumIDList* pEnumIL;
} TV_ITEMDATA, *LPTV_ITEMDATA; } TV_ITEMDATA, *LPTV_ITEMDATA;
static BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName) static BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName)
...@@ -127,43 +173,23 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPWSTR ...@@ -127,43 +173,23 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPWSTR
return bSuccess; return bSuccess;
} }
static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hParent) static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPITEMIDLIST pidl, LPITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent)
{ {
TVITEMW tvi; TVITEMW tvi;
TVINSERTSTRUCTW tvins; TVINSERTSTRUCTW tvins;
HTREEITEM hPrev = 0;
LPENUMIDLIST lpe=0;
LPITEMIDLIST pidlTemp=0;
LPTV_ITEMDATA lptvid=0;
ULONG ulFetched;
HRESULT hr;
WCHAR szBuff[MAX_PATH]; WCHAR szBuff[MAX_PATH];
HWND hwnd=GetParent(hwndTreeView); LPTV_ITEMDATA lptvid=0;
TRACE("%p %p %x\n",lpsf, pidl, (INT)hParent);
SetCapture(GetParent(hwndTreeView));
SetCursor(LoadCursorA(0, IDC_WAITA));
hr=IShellFolder_EnumObjects(lpsf, hwnd, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &lpe);
if (SUCCEEDED(hr)) tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
{ 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;
if (ulAttrs & SFGAO_HASSUBFOLDER) tvi.cChildren= pEnumIL ? 1 : 0;
{ tvi.cChildren=1;
tvi.mask |= TVIF_CHILDREN; tvi.mask |= TVIF_CHILDREN;
}
if (!(lptvid = (LPTV_ITEMDATA)SHAlloc(sizeof(TV_ITEMDATA)))) if (!(lptvid = (LPTV_ITEMDATA)SHAlloc(sizeof(TV_ITEMDATA))))
goto Done; return NULL;
if (!GetName(lpsf, pidlTemp, SHGDN_NORMAL, szBuff)) if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
goto Done; return NULL;
tvi.pszText = szBuff; tvi.pszText = szBuff;
tvi.cchTextMax = MAX_PATH; tvi.cchTextMax = MAX_PATH;
...@@ -171,33 +197,99 @@ static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hPar ...@@ -171,33 +197,99 @@ static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hPar
IShellFolder_AddRef(lpsf); IShellFolder_AddRef(lpsf);
lptvid->lpsfParent = lpsf; lptvid->lpsfParent = lpsf;
lptvid->lpi = ILClone(pidlTemp); lptvid->lpi = ILClone(pidl);
lptvid->lpifq = ILCombine(pidl, pidlTemp); lptvid->lpifq = pidlParent ? ILCombine(pidlParent, pidl) : ILClone(pidl);
lptvid->pEnumIL = pEnumIL;
GetNormalAndSelectedIcons(lptvid->lpifq, &tvi); GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
tvins.DUMMYUNIONNAME.item = tvi; tvins.DUMMYUNIONNAME.item = tvi;
tvins.hInsertAfter = hPrev; tvins.hInsertAfter = NULL;
tvins.hParent = hParent; tvins.hParent = hParent;
hPrev = (HTREEITEM)TreeView_InsertItemW(hwndTreeView, &tvins); return (HTREEITEM)TreeView_InsertItemW(hwndTreeView, &tvins);
}
static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hParent, IEnumIDList* lpe)
{
HTREEITEM hPrev = 0;
LPITEMIDLIST pidlTemp=0;
ULONG ulFetched;
HRESULT hr;
HWND hwnd=GetParent(hwndTreeView);
TRACE("%p %p %x\n",lpsf, pidl, (INT)hParent);
SetCapture(GetParent(hwndTreeView));
SetCursor(LoadCursorA(0, IDC_WAITA));
while (NOERROR == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched))
{
ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
IEnumIDList* pEnumIL = NULL;
IShellFolder* pSFChild = NULL;
IShellFolder_GetAttributesOf(lpsf, 1, &pidlTemp, &ulAttrs);
if (ulAttrs & SFGAO_FOLDER)
{
hr = IShellFolder_BindToObject(lpsf,pidlTemp,NULL,&IID_IShellFolder,(LPVOID*)&pSFChild);
if (SUCCEEDED(hr))
hr = IShellFolder_EnumObjects(pSFChild, hwnd, BrowseFlagsToSHCONTF(lpBrowseInfo->ulFlags), &pEnumIL);
if (SUCCEEDED(hr))
{
if ((IEnumIDList_Skip(pEnumIL, 1) != S_OK) || FAILED(IEnumIDList_Reset(pEnumIL)))
{
IEnumIDList_Release(pEnumIL);
pEnumIL = NULL;
} }
} }
SHFree(pidlTemp); /* Finally, free the pidl that the shell gave us... */ IShellFolder_Release(pSFChild);
pidlTemp=0;
} }
if (!(hPrev = InsertTreeViewItem(lpsf, pidlTemp, pidl, pEnumIL, hParent)))
goto Done;
SHFree(pidlTemp); /* Finally, free the pidl that the shell gave us... */
pidlTemp=NULL;
} }
Done: Done:
ReleaseCapture(); ReleaseCapture();
SetCursor(LoadCursorW(0, IDC_ARROWW)); SetCursor(LoadCursorW(0, IDC_ARROWW));
if (lpe) if (pidlTemp)
IEnumIDList_Release(lpe);
if (pidlTemp )
SHFree(pidlTemp); SHFree(pidlTemp);
} }
static inline BOOL PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type)
{
LPPIDLDATA data = _ILGetDataPointer(pidl);
if (!data)
return FALSE;
return (data->type == type);
}
static void BrsFolder_CheckValidSelection(HWND hWndTree, LPTV_ITEMDATA lptvid)
{
LPCITEMIDLIST pidl = lptvid->lpi;
BOOL bEnabled = TRUE;
DWORD dwAttributes;
if ((lpBrowseInfo->ulFlags & BIF_BROWSEFORCOMPUTER) &&
!PIDLIsType(pidl, PT_COMP))
bEnabled = FALSE;
if (lpBrowseInfo->ulFlags & BIF_RETURNFSANCESTORS)
{
dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM;
if (FAILED(IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, &lptvid->lpi, &dwAttributes)) ||
!dwAttributes)
bEnabled = FALSE;
}
if (lpBrowseInfo->ulFlags & BIF_RETURNONLYFSDIRS)
{
dwAttributes = SFGAO_FOLDER | SFGAO_FILESYSTEM;
if (FAILED(IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, &lptvid->lpi, &dwAttributes)) ||
(dwAttributes != (SFGAO_FOLDER | SFGAO_FILESYSTEM)))
bEnabled = FALSE;
}
SendMessageW(hWndTree, BFFM_ENABLEOK, 0, (LPARAM)bEnabled);
}
static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh) static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh)
{ {
NMTREEVIEWW *pnmtv = (NMTREEVIEWW *)lpnmh; NMTREEVIEWW *pnmtv = (NMTREEVIEWW *)lpnmh;
...@@ -210,26 +302,29 @@ static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh) ...@@ -210,26 +302,29 @@ static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh)
switch (pnmtv->hdr.idFrom) switch (pnmtv->hdr.idFrom)
{ case IDD_TREEVIEW: { case IDD_TREEVIEW:
switch (pnmtv->hdr.code) switch (pnmtv->hdr.code)
{ case TVN_DELETEITEMA: {
case TVN_DELETEITEMA:
case TVN_DELETEITEMW: case TVN_DELETEITEMW:
{ FIXME("TVN_DELETEITEMA/W\n"); TRACE("TVN_DELETEITEMA/W\n");
lptvid=(LPTV_ITEMDATA)pnmtv->itemOld.lParam; lptvid=(LPTV_ITEMDATA)pnmtv->itemOld.lParam;
IShellFolder_Release(lptvid->lpsfParent); IShellFolder_Release(lptvid->lpsfParent);
if (lptvid->pEnumIL)
IEnumIDList_Release(lptvid->pEnumIL);
SHFree(lptvid->lpi); SHFree(lptvid->lpi);
SHFree(lptvid->lpifq); SHFree(lptvid->lpifq);
SHFree(lptvid); SHFree(lptvid);
}
break; break;
case TVN_ITEMEXPANDINGA: case TVN_ITEMEXPANDINGA:
case TVN_ITEMEXPANDINGW: case TVN_ITEMEXPANDINGW:
{ FIXME("TVN_ITEMEXPANDINGA/W\n"); {
TRACE("TVN_ITEMEXPANDINGA/W\n");
if ((pnmtv->itemNew.state & TVIS_EXPANDEDONCE)) if ((pnmtv->itemNew.state & TVIS_EXPANDEDONCE))
break; break;
lptvid=(LPTV_ITEMDATA)pnmtv->itemNew.lParam; lptvid=(LPTV_ITEMDATA)pnmtv->itemNew.lParam;
if (SUCCEEDED(IShellFolder_BindToObject(lptvid->lpsfParent, lptvid->lpi,0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf2))) if (SUCCEEDED(IShellFolder_BindToObject(lptvid->lpsfParent, lptvid->lpi,0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf2)))
{ FillTreeView( lpsf2, lptvid->lpifq, pnmtv->itemNew.hItem ); { FillTreeView( lpsf2, lptvid->lpifq, pnmtv->itemNew.hItem, lptvid->pEnumIL);
} }
TreeView_SortChildren(hwndTreeView, pnmtv->itemNew.hItem, FALSE); TreeView_SortChildren(hwndTreeView, pnmtv->itemNew.hItem, FALSE);
} }
...@@ -240,10 +335,11 @@ static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh) ...@@ -240,10 +335,11 @@ static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh)
pidlRet = lptvid->lpifq; pidlRet = lptvid->lpifq;
if (lpBrowseInfo->lpfn) if (lpBrowseInfo->lpfn)
(lpBrowseInfo->lpfn)(hWnd, BFFM_SELCHANGED, (LPARAM)pidlRet, lpBrowseInfo->lParam); (lpBrowseInfo->lpfn)(hWnd, BFFM_SELCHANGED, (LPARAM)pidlRet, lpBrowseInfo->lParam);
BrsFolder_CheckValidSelection(hWnd, lptvid);
break; break;
default: default:
FIXME("unhandled (%d)\n", pnmtv->hdr.code); WARN("unhandled (%d)\n", pnmtv->hdr.code);
break; break;
} }
break; break;
...@@ -268,8 +364,8 @@ static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam, ...@@ -268,8 +364,8 @@ static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
{ case WM_INITDIALOG: { case WM_INITDIALOG:
pidlRet = NULL; pidlRet = NULL;
lpBrowseInfo = (LPBROWSEINFOW) lParam; lpBrowseInfo = (LPBROWSEINFOW) lParam;
if (lpBrowseInfo->ulFlags & ~(BIF_STATUSTEXT)) if (lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS)
FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~(BIF_STATUSTEXT)); FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS);
if (lpBrowseInfo->lpszTitle) { if (lpBrowseInfo->lpszTitle) {
SetWindowTextW(GetDlgItem(hWnd, IDD_TITLE), lpBrowseInfo->lpszTitle); SetWindowTextW(GetDlgItem(hWnd, IDD_TITLE), lpBrowseInfo->lpszTitle);
} else { } else {
...@@ -278,15 +374,10 @@ static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam, ...@@ -278,15 +374,10 @@ static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT)) if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT))
ShowWindow(GetDlgItem(hWnd, IDD_STATUS), SW_HIDE); ShowWindow(GetDlgItem(hWnd, IDD_STATUS), SW_HIDE);
if (lpBrowseInfo->pidlRoot )
FIXME("root is desktop\n");
InitializeTreeView(hWnd, lpBrowseInfo->pidlRoot); InitializeTreeView(hWnd, lpBrowseInfo->pidlRoot);
if (lpBrowseInfo->lpfn) { if (lpBrowseInfo->lpfn)
(lpBrowseInfo->lpfn)(hWnd, BFFM_INITIALIZED, 0, lpBrowseInfo->lParam); (lpBrowseInfo->lpfn)(hWnd, BFFM_INITIALIZED, 0, lpBrowseInfo->lParam);
(lpBrowseInfo->lpfn)(hWnd, BFFM_SELCHANGED, 0/*FIXME*/, lpBrowseInfo->lParam);
}
return TRUE; return TRUE;
...@@ -319,17 +410,27 @@ static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam, ...@@ -319,17 +410,27 @@ static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
TRACE("Enable %ld\n", lParam); TRACE("Enable %ld\n", lParam);
EnableWindow(GetDlgItem(hWnd, 1), (lParam)?TRUE:FALSE); EnableWindow(GetDlgItem(hWnd, 1), (lParam)?TRUE:FALSE);
break; break;
case BFFM_SETOKTEXT: /* unicode only */
TRACE("Set OK text %s\n", debugstr_w((LPWSTR)wParam));
SetWindowTextW(GetDlgItem(hWnd, 1), (LPWSTR)wParam);
break;
case BFFM_SETSELECTIONA: case BFFM_SETSELECTIONA:
if (wParam) if (wParam)
TRACE("Set selection %s\n", debugstr_a((LPSTR)lParam)); FIXME("Set selection %s\n", debugstr_a((LPSTR)lParam));
else else
TRACE("Set selection %p\n", (void*)lParam); FIXME("Set selection %p\n", (void*)lParam);
break; break;
case BFFM_SETSELECTIONW: case BFFM_SETSELECTIONW:
if (wParam) if (wParam)
TRACE("Set selection %s\n", debugstr_w((LPWSTR)lParam)); FIXME("Set selection %s\n", debugstr_w((LPWSTR)lParam));
else
FIXME("Set selection %p\n", (void*)lParam);
break;
case BFFM_SETEXPANDED: /* unicode only */
if (wParam)
FIXME("Set expanded %s\n", debugstr_w((LPWSTR)lParam));
else else
TRACE("Set selection %p\n", (void*)lParam); FIXME("Set expanded %p\n", (void*)lParam);
break; break;
} }
return FALSE; return FALSE;
......
...@@ -292,6 +292,8 @@ typedef struct tagBROWSEINFOW { ...@@ -292,6 +292,8 @@ typedef struct tagBROWSEINFOW {
#define BFFM_SETSELECTIONA (WM_USER+102) #define BFFM_SETSELECTIONA (WM_USER+102)
#define BFFM_SETSELECTIONW (WM_USER+103) #define BFFM_SETSELECTIONW (WM_USER+103)
#define BFFM_SETSTATUSTEXTW (WM_USER+104) #define BFFM_SETSTATUSTEXTW (WM_USER+104)
#define BFFM_SETOKTEXT (WM_USER+105)
#define BFFM_SETEXPANDED (WM_USER+106)
LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi); LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi);
LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi); LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment