1999-07-27 18:20:36 +02:00
|
|
|
/*
|
|
|
|
* Implementation of IShellBrowser for the File Open common dialog
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* Copyright 1999 Francois Boisvert
|
|
|
|
* Copyright 1999, 2000 Juergen Schmied
|
1999-07-27 18:20:36 +02:00
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1999-07-27 18:20:36 +02:00
|
|
|
*/
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
1999-07-27 18:20:36 +02:00
|
|
|
#include <stdio.h>
|
2001-01-26 21:43:40 +01:00
|
|
|
#include <string.h>
|
2000-11-08 06:05:15 +01:00
|
|
|
|
2004-10-07 05:06:48 +02:00
|
|
|
#define COBJMACROS
|
2003-01-07 21:36:20 +01:00
|
|
|
#define NONAMELESSUNION
|
2004-10-07 05:06:48 +02:00
|
|
|
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "windef.h"
|
2000-12-19 05:53:20 +01:00
|
|
|
#include "winbase.h"
|
2000-11-28 23:40:56 +01:00
|
|
|
#include "winnls.h"
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "wingdi.h"
|
1999-07-27 18:20:36 +02:00
|
|
|
#include "winuser.h"
|
2001-11-06 23:31:19 +01:00
|
|
|
#include "winreg.h"
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2001-12-11 01:30:17 +01:00
|
|
|
#define NO_SHLWAPI_STREAM
|
2001-01-17 23:05:24 +01:00
|
|
|
#include "shlwapi.h"
|
2000-11-12 04:50:10 +01:00
|
|
|
#include "filedlgbrowser.h"
|
|
|
|
#include "cdlg.h"
|
|
|
|
#include "shlguid.h"
|
2003-09-03 02:16:28 +02:00
|
|
|
#include "servprov.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2018-03-21 06:59:42 +01:00
|
|
|
#include "wine/heap.h"
|
2000-11-01 02:50:21 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2000-11-01 02:50:21 +01:00
|
|
|
typedef struct
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowser IShellBrowser_iface;
|
|
|
|
ICommDlgBrowser ICommDlgBrowser_iface;
|
|
|
|
IServiceProvider IServiceProvider_iface;
|
2005-07-05 16:11:04 +02:00
|
|
|
LONG ref; /* Reference counter */
|
2000-11-01 02:50:21 +01:00
|
|
|
HWND hwndOwner; /* Owner dialog of the interface */
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2000-11-01 02:50:21 +01:00
|
|
|
} IShellBrowserImpl;
|
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
static inline IShellBrowserImpl *impl_from_IShellBrowser(IShellBrowser *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, IShellBrowserImpl, IShellBrowser_iface);
|
|
|
|
}
|
|
|
|
|
2005-07-27 13:10:52 +02:00
|
|
|
static inline IShellBrowserImpl *impl_from_ICommDlgBrowser( ICommDlgBrowser *iface )
|
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
return CONTAINING_RECORD(iface, IShellBrowserImpl, ICommDlgBrowser_iface);
|
2005-07-27 13:10:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline IShellBrowserImpl *impl_from_IServiceProvider( IServiceProvider *iface )
|
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
return CONTAINING_RECORD(iface, IShellBrowserImpl, IServiceProvider_iface);
|
2005-07-27 13:10:52 +02:00
|
|
|
}
|
|
|
|
|
2000-11-01 02:50:21 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* vtable
|
|
|
|
*/
|
2005-05-27 22:17:35 +02:00
|
|
|
static const IShellBrowserVtbl IShellBrowserImpl_Vtbl;
|
|
|
|
static const ICommDlgBrowserVtbl IShellBrowserImpl_ICommDlgBrowser_Vtbl;
|
|
|
|
static const IServiceProviderVtbl IShellBrowserImpl_IServiceProvider_Vtbl;
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2000-11-01 02:50:21 +01:00
|
|
|
/*
|
|
|
|
* Helper functions
|
|
|
|
*/
|
|
|
|
|
2005-04-19 11:47:42 +02:00
|
|
|
#define add_flag(a) if (flags & a) {strcat(str, #a );strcat(str," ");}
|
|
|
|
static void COMDLG32_DumpSBSPFlags(UINT uflags)
|
|
|
|
{
|
|
|
|
if (TRACE_ON(commdlg))
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
static const struct {
|
|
|
|
DWORD mask;
|
|
|
|
const char *name;
|
|
|
|
} flags[] = {
|
|
|
|
#define FE(x) { x, #x}
|
|
|
|
/* SBSP_DEFBROWSER == 0 */
|
|
|
|
FE(SBSP_SAMEBROWSER),
|
|
|
|
FE(SBSP_NEWBROWSER),
|
|
|
|
|
|
|
|
/* SBSP_DEFMODE == 0 */
|
|
|
|
FE(SBSP_OPENMODE),
|
|
|
|
FE(SBSP_EXPLOREMODE),
|
|
|
|
FE(SBSP_HELPMODE),
|
|
|
|
FE(SBSP_NOTRANSFERHIST),
|
|
|
|
|
|
|
|
/* SBSP_ABSOLUTE == 0 */
|
|
|
|
FE(SBSP_RELATIVE),
|
|
|
|
FE(SBSP_PARENT),
|
|
|
|
FE(SBSP_NAVIGATEBACK),
|
|
|
|
FE(SBSP_NAVIGATEFORWARD),
|
|
|
|
FE(SBSP_ALLOW_AUTONAVIGATE),
|
|
|
|
|
|
|
|
FE(SBSP_NOAUTOSELECT),
|
|
|
|
FE(SBSP_WRITENOHISTORY),
|
|
|
|
|
|
|
|
FE(SBSP_REDIRECT),
|
|
|
|
FE(SBSP_INITIATEDBYHLINKFRAME),
|
|
|
|
};
|
|
|
|
#undef FE
|
2007-12-04 23:26:01 +01:00
|
|
|
TRACE("SBSP Flags: %08x =", uflags);
|
2018-03-20 08:37:49 +01:00
|
|
|
for (i = 0; i < ARRAY_SIZE(flags); i++)
|
2005-04-19 11:47:42 +02:00
|
|
|
if (flags[i].mask & uflags)
|
2007-12-04 23:26:01 +01:00
|
|
|
TRACE("%s ", flags[i].name);
|
|
|
|
TRACE("\n");
|
2005-04-19 11:47:42 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-04-04 23:23:04 +02:00
|
|
|
static void COMDLG32_UpdateCurrentDir(const FileOpenDlgInfos *fodInfos)
|
2000-12-18 04:12:06 +01:00
|
|
|
{
|
2005-05-26 14:23:57 +02:00
|
|
|
LPSHELLFOLDER psfDesktop;
|
|
|
|
STRRET strret;
|
|
|
|
HRESULT res;
|
|
|
|
|
|
|
|
res = SHGetDesktopFolder(&psfDesktop);
|
|
|
|
if (FAILED(res))
|
|
|
|
return;
|
|
|
|
|
|
|
|
res = IShellFolder_GetDisplayNameOf(psfDesktop, fodInfos->ShellInfos.pidlAbsCurrent,
|
|
|
|
SHGDN_FORPARSING, &strret);
|
|
|
|
if (SUCCEEDED(res)) {
|
|
|
|
WCHAR wszCurrentDir[MAX_PATH];
|
|
|
|
|
|
|
|
res = StrRetToBufW(&strret, fodInfos->ShellInfos.pidlAbsCurrent, wszCurrentDir, MAX_PATH);
|
|
|
|
if (SUCCEEDED(res))
|
|
|
|
SetCurrentDirectoryW(wszCurrentDir);
|
2002-06-28 19:34:57 +02:00
|
|
|
}
|
2005-05-26 14:23:57 +02:00
|
|
|
|
|
|
|
IShellFolder_Release(psfDesktop);
|
2000-12-18 04:12:06 +01:00
|
|
|
}
|
|
|
|
|
2000-11-01 02:50:21 +01:00
|
|
|
/* copied from shell32 to avoid linking to it */
|
2009-01-22 23:39:19 +01:00
|
|
|
static BOOL COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPCITEMIDLIST pidl)
|
2000-11-01 02:50:21 +01:00
|
|
|
{
|
2022-02-09 09:25:26 +01:00
|
|
|
TRACE("dest=%p len=0x%lx strret=%p pidl=%p\n", dest , len, src, pidl);
|
2000-11-01 02:50:21 +01:00
|
|
|
|
|
|
|
switch (src->uType)
|
|
|
|
{
|
|
|
|
case STRRET_WSTR:
|
2009-01-13 23:30:08 +01:00
|
|
|
lstrcpynW(dest, src->u.pOleStr, len);
|
2018-03-21 06:59:42 +01:00
|
|
|
CoTaskMemFree(src->u.pOleStr);
|
2000-11-01 02:50:21 +01:00
|
|
|
break;
|
|
|
|
|
2002-07-02 04:05:17 +02:00
|
|
|
case STRRET_CSTR:
|
2009-01-13 23:30:08 +01:00
|
|
|
if (len && !MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, dest, len ))
|
2000-11-28 23:40:56 +01:00
|
|
|
((LPWSTR)dest)[len-1] = 0;
|
2000-11-01 02:50:21 +01:00
|
|
|
break;
|
|
|
|
|
2002-07-02 04:05:17 +02:00
|
|
|
case STRRET_OFFSET:
|
2000-11-01 02:50:21 +01:00
|
|
|
if (pidl)
|
|
|
|
{
|
2000-11-28 23:40:56 +01:00
|
|
|
if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset,
|
2009-01-13 23:30:08 +01:00
|
|
|
-1, dest, len ))
|
2000-11-28 23:40:56 +01:00
|
|
|
((LPWSTR)dest)[len-1] = 0;
|
2000-11-01 02:50:21 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME("unknown type!\n");
|
|
|
|
if (len)
|
2000-11-28 23:40:56 +01:00
|
|
|
{ *(LPWSTR)dest = '\0';
|
2000-11-01 02:50:21 +01:00
|
|
|
}
|
|
|
|
return(FALSE);
|
|
|
|
}
|
2009-01-22 23:39:19 +01:00
|
|
|
return TRUE;
|
2000-11-01 02:50:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IShellBrowser
|
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_Construct
|
|
|
|
*/
|
|
|
|
IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner)
|
|
|
|
{
|
2017-02-21 13:35:17 +01:00
|
|
|
FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwndOwner);
|
1999-07-27 18:20:36 +02:00
|
|
|
IShellBrowserImpl *sb;
|
|
|
|
|
2018-03-21 06:59:42 +01:00
|
|
|
sb = heap_alloc(sizeof(*sb));
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
/* Initialisation of the member variables */
|
|
|
|
sb->ref=1;
|
|
|
|
sb->hwndOwner = hwndOwner;
|
|
|
|
|
|
|
|
/* Initialisation of the vTables */
|
2010-12-31 11:13:44 +01:00
|
|
|
sb->IShellBrowser_iface.lpVtbl = &IShellBrowserImpl_Vtbl;
|
|
|
|
sb->ICommDlgBrowser_iface.lpVtbl = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
|
|
|
|
sb->IServiceProvider_iface.lpVtbl = &IShellBrowserImpl_IServiceProvider_Vtbl;
|
2001-01-17 23:05:24 +01:00
|
|
|
SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
|
1999-07-27 18:20:36 +02:00
|
|
|
&fodInfos->ShellInfos.pidlAbsCurrent);
|
|
|
|
|
|
|
|
TRACE("%p\n", sb);
|
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
return &sb->IShellBrowser_iface;
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* IShellBrowserImpl_QueryInterface
|
|
|
|
*/
|
2017-05-31 05:16:02 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface, REFIID riid, void **ppvObj)
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2017-05-31 05:16:02 +02:00
|
|
|
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObj);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
*ppvObj = NULL;
|
|
|
|
|
2012-08-16 13:19:27 +02:00
|
|
|
if(IsEqualIID(riid, &IID_IUnknown))
|
|
|
|
*ppvObj = &This->IShellBrowser_iface;
|
|
|
|
else if(IsEqualIID(riid, &IID_IOleWindow))
|
|
|
|
*ppvObj = &This->IShellBrowser_iface;
|
|
|
|
else if(IsEqualIID(riid, &IID_IShellBrowser))
|
|
|
|
*ppvObj = &This->IShellBrowser_iface;
|
|
|
|
else if(IsEqualIID(riid, &IID_ICommDlgBrowser))
|
2010-12-31 11:13:44 +01:00
|
|
|
*ppvObj = &This->ICommDlgBrowser_iface;
|
2012-08-16 13:19:27 +02:00
|
|
|
else if(IsEqualIID(riid, &IID_IServiceProvider))
|
2010-12-31 11:13:44 +01:00
|
|
|
*ppvObj = &This->IServiceProvider_iface;
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2012-08-16 13:19:27 +02:00
|
|
|
if(*ppvObj) {
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppvObj);
|
|
|
|
return S_OK;
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
2012-08-16 13:19:27 +02:00
|
|
|
|
2017-05-31 05:16:02 +02:00
|
|
|
FIXME("unsupported interface, %s\n", debugstr_guid(riid));
|
1999-07-27 18:20:36 +02:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowser::AddRef
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface)
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
2005-01-10 13:25:29 +01:00
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2022-02-09 09:25:26 +01:00
|
|
|
TRACE("(%p,%lu)\n", This, ref - 1);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2005-01-10 13:25:29 +01:00
|
|
|
return ref;
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_Release
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
2005-01-10 13:25:29 +01:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2022-02-09 09:25:26 +01:00
|
|
|
TRACE("(%p,%lu)\n", This, ref + 1);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2005-01-10 13:25:29 +01:00
|
|
|
if (!ref)
|
2018-03-21 06:59:42 +01:00
|
|
|
heap_free(This);
|
|
|
|
|
2005-01-10 13:25:29 +01:00
|
|
|
return ref;
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IOleWindow
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_GetWindow (IOleWindow)
|
|
|
|
*
|
|
|
|
* Inherited from IOleWindow::GetWindow
|
|
|
|
*
|
|
|
|
* See Windows documentation for more details
|
|
|
|
*
|
|
|
|
* Note : We will never be window less in the File Open dialog
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
1999-07-27 18:20:36 +02:00
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
HWND * phwnd)
|
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
if(!This->hwndOwner)
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
*phwnd = This->hwndOwner;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
return (*phwnd) ? S_OK : E_UNEXPECTED;
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_ContextSensitiveHelp
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser * iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
BOOL fEnterMode)
|
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IShellBrowser
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_BrowseObject
|
|
|
|
*
|
|
|
|
* See Windows documentation on IShellBrowser::BrowseObject for more details
|
|
|
|
*
|
2002-06-01 01:06:46 +02:00
|
|
|
* This function will override user specified flags and will always
|
|
|
|
* use SBSP_DEFBROWSER and SBSP_DEFMODE.
|
1999-07-27 18:20:36 +02:00
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
|
2002-06-01 01:06:46 +02:00
|
|
|
LPCITEMIDLIST pidl,
|
1999-07-27 18:20:36 +02:00
|
|
|
UINT wFlags)
|
|
|
|
{
|
|
|
|
HRESULT hRes;
|
2018-04-01 10:32:24 +02:00
|
|
|
IShellFolder *folder;
|
1999-07-27 18:20:36 +02:00
|
|
|
IShellView *psvTmp;
|
|
|
|
FileOpenDlgInfos *fodInfos;
|
|
|
|
LPITEMIDLIST pidlTmp;
|
2000-06-16 23:51:33 +02:00
|
|
|
HWND hwndView;
|
|
|
|
HWND hDlgWnd;
|
|
|
|
BOOL bViewHasFocus;
|
2003-08-21 23:25:16 +02:00
|
|
|
RECT rectView;
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2005-04-19 11:47:42 +02:00
|
|
|
TRACE("(%p)(pidl=%p,flags=0x%08x)\n", This, pidl, wFlags);
|
|
|
|
COMDLG32_DumpSBSPFlags(wFlags);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2017-02-21 13:35:17 +01:00
|
|
|
fodInfos = get_filedlg_infoptr(This->hwndOwner);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
/* Format the pidl according to its parameter's category */
|
|
|
|
if(wFlags & SBSP_RELATIVE)
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/* SBSP_RELATIVE A relative pidl (relative from the current folder) */
|
2018-04-01 10:32:24 +02:00
|
|
|
if (FAILED(hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder,
|
|
|
|
pidl, NULL, &IID_IShellFolder, (void **)&folder)))
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2000-06-16 23:51:33 +02:00
|
|
|
ERR("bind to object failed\n");
|
|
|
|
return hRes;
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
|
|
|
/* create an absolute pidl */
|
2018-03-21 06:59:42 +01:00
|
|
|
pidlTmp = ILCombine(fodInfos->ShellInfos.pidlAbsCurrent, pidl);
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
|
|
|
else if(wFlags & SBSP_PARENT)
|
|
|
|
{
|
|
|
|
/* Browse the parent folder (ignores the pidl) */
|
|
|
|
pidlTmp = GetParentPidl(fodInfos->ShellInfos.pidlAbsCurrent);
|
2018-04-01 10:32:24 +02:00
|
|
|
folder = GetShellFolderFromPidl(pidlTmp);
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
2000-06-02 21:36:53 +02:00
|
|
|
else /* SBSP_ABSOLUTE is 0x0000 */
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
|
|
|
/* An absolute pidl (relative from the desktop) */
|
2018-03-21 06:59:42 +01:00
|
|
|
pidlTmp = ILClone(pidl);
|
2018-04-01 10:32:24 +02:00
|
|
|
folder = GetShellFolderFromPidl(pidlTmp);
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2018-04-01 10:32:24 +02:00
|
|
|
if (!folder)
|
2000-11-01 02:50:21 +01:00
|
|
|
{
|
2018-04-01 10:32:24 +02:00
|
|
|
ERR("could not browse to folder\n");
|
|
|
|
ILFree(pidlTmp);
|
|
|
|
return E_FAIL;
|
2000-11-01 02:50:21 +01:00
|
|
|
}
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
/* If the pidl to browse to is equal to the actual pidl ...
|
1999-09-19 20:27:05 +02:00
|
|
|
do nothing and pretend you did it*/
|
2018-03-21 06:59:42 +01:00
|
|
|
if (ILIsEqual(pidlTmp, fodInfos->ShellInfos.pidlAbsCurrent))
|
1999-09-19 20:27:05 +02:00
|
|
|
{
|
2018-04-01 10:32:24 +02:00
|
|
|
IShellFolder_Release(folder);
|
2018-03-21 06:59:42 +01:00
|
|
|
ILFree(pidlTmp);
|
2000-11-01 02:50:21 +01:00
|
|
|
TRACE("keep current folder\n");
|
2018-04-01 10:32:24 +02:00
|
|
|
return S_OK;
|
1999-09-19 20:27:05 +02:00
|
|
|
}
|
|
|
|
|
2000-06-02 21:36:53 +02:00
|
|
|
/* Release the current DataObject */
|
|
|
|
if (fodInfos->Shell.FOIDataObject)
|
|
|
|
{
|
|
|
|
IDataObject_Release(fodInfos->Shell.FOIDataObject);
|
|
|
|
fodInfos->Shell.FOIDataObject = NULL;
|
|
|
|
}
|
|
|
|
|
2000-06-16 23:51:33 +02:00
|
|
|
/* Create the associated view */
|
2000-11-01 02:50:21 +01:00
|
|
|
TRACE("create view object\n");
|
2018-04-01 10:32:24 +02:00
|
|
|
if (FAILED(hRes = IShellFolder_CreateViewObject(folder, fodInfos->ShellInfos.hwndOwner,
|
|
|
|
&IID_IShellView, (void **)&psvTmp)))
|
|
|
|
{
|
|
|
|
IShellFolder_Release(folder);
|
|
|
|
ILFree(pidlTmp);
|
|
|
|
return hRes;
|
|
|
|
}
|
2000-06-16 23:51:33 +02:00
|
|
|
|
|
|
|
/* Check if listview has focus */
|
|
|
|
bViewHasFocus = IsChild(fodInfos->ShellInfos.hwndView,GetFocus());
|
|
|
|
|
|
|
|
/* Get the foldersettings from the old view */
|
|
|
|
if(fodInfos->Shell.FOIShellView)
|
|
|
|
IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, &fodInfos->ShellInfos.folderSettings);
|
|
|
|
|
|
|
|
/* Release the old fodInfos->Shell.FOIShellView and update its value.
|
|
|
|
We have to update this early since ShellView_CreateViewWindow of native
|
|
|
|
shell32 calls OnStateChange and needs the correct view here.*/
|
|
|
|
if(fodInfos->Shell.FOIShellView)
|
|
|
|
{
|
|
|
|
IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView);
|
|
|
|
IShellView_Release(fodInfos->Shell.FOIShellView);
|
|
|
|
}
|
|
|
|
fodInfos->Shell.FOIShellView = psvTmp;
|
|
|
|
|
|
|
|
/* Release old FOIShellFolder and update its value */
|
2000-06-02 21:36:53 +02:00
|
|
|
if (fodInfos->Shell.FOIShellFolder)
|
|
|
|
IShellFolder_Release(fodInfos->Shell.FOIShellFolder);
|
2018-04-01 10:32:24 +02:00
|
|
|
fodInfos->Shell.FOIShellFolder = folder;
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2000-06-16 23:51:33 +02:00
|
|
|
/* Release old pidlAbsCurrent and update its value */
|
2018-03-21 06:59:42 +01:00
|
|
|
ILFree(fodInfos->ShellInfos.pidlAbsCurrent);
|
2000-06-16 23:51:33 +02:00
|
|
|
fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2000-12-18 04:12:06 +01:00
|
|
|
COMDLG32_UpdateCurrentDir(fodInfos);
|
|
|
|
|
2003-08-21 23:25:16 +02:00
|
|
|
GetWindowRect(GetDlgItem(This->hwndOwner, IDC_SHELLSTATIC), &rectView);
|
|
|
|
MapWindowPoints(0, This->hwndOwner, (LPPOINT)&rectView, 2);
|
|
|
|
|
2000-06-16 23:51:33 +02:00
|
|
|
/* Create the window */
|
|
|
|
TRACE("create view window\n");
|
2018-04-01 10:32:24 +02:00
|
|
|
if (FAILED(hRes = IShellView_CreateViewWindow(psvTmp, NULL,
|
|
|
|
&fodInfos->ShellInfos.folderSettings, fodInfos->Shell.FOIShellBrowser,
|
|
|
|
&rectView, &hwndView)))
|
|
|
|
{
|
2022-02-09 09:25:26 +01:00
|
|
|
WARN("Failed to create view window, hr %#lx.\n", hRes);
|
2018-04-01 10:32:24 +02:00
|
|
|
return hRes;
|
|
|
|
}
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2000-06-16 23:51:33 +02:00
|
|
|
fodInfos->ShellInfos.hwndView = hwndView;
|
|
|
|
|
2006-02-11 18:41:23 +01:00
|
|
|
/* Set view window control id to 5002 */
|
|
|
|
SetWindowLongPtrW(hwndView, GWLP_ID, lst2);
|
2013-05-29 16:17:48 +02:00
|
|
|
SendMessageW( hwndView, WM_SETFONT, SendMessageW( GetParent(hwndView), WM_GETFONT, 0, 0 ), FALSE );
|
2006-02-11 18:41:23 +01:00
|
|
|
|
2000-06-16 23:51:33 +02:00
|
|
|
/* Select the new folder in the Look In combo box of the Open file dialog */
|
1999-07-27 18:20:36 +02:00
|
|
|
FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent);
|
2000-06-16 23:51:33 +02:00
|
|
|
|
|
|
|
/* changes the tab order of the ListView to reflect the window's File Dialog */
|
2002-06-01 01:06:46 +02:00
|
|
|
hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN);
|
2000-06-16 23:51:33 +02:00
|
|
|
SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
|
|
|
|
|
/* Since we destroyed the old view if it had focus set focus to the newly created view */
|
|
|
|
if (bViewHasFocus)
|
|
|
|
SetFocus(fodInfos->ShellInfos.hwndView);
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
return hRes;
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_EnableModelessSB
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
BOOL fEnable)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_GetControlWindow
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
|
2002-06-01 01:06:46 +02:00
|
|
|
UINT id,
|
1999-07-27 18:20:36 +02:00
|
|
|
HWND *lphwnd)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_GetViewStateStream
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
|
2002-06-01 01:06:46 +02:00
|
|
|
DWORD grfMode,
|
1999-07-27 18:20:36 +02:00
|
|
|
LPSTREAM *ppStrm)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2022-02-09 09:25:26 +01:00
|
|
|
FIXME("(%p 0x%08lx %p)\n", This, grfMode, ppStrm);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_InsertMenusSB
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
HMENU hmenuShared,
|
|
|
|
LPOLEMENUGROUPWIDTHS lpMenuWidths)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_OnViewWindowActive
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
IShellView *ppshv)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_QueryActiveShellView
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
IShellView **ppshv)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
FileOpenDlgInfos *fodInfos;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2017-02-21 13:35:17 +01:00
|
|
|
fodInfos = get_filedlg_infoptr(This->hwndOwner);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
if(!(*ppshv = fodInfos->Shell.FOIShellView))
|
|
|
|
{
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
IShellView_AddRef(fodInfos->Shell.FOIShellView);
|
|
|
|
return NOERROR;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_RemoveMenusSB
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
HMENU hmenuShared)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_SendControlMsg
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
|
2002-06-01 01:06:46 +02:00
|
|
|
UINT id,
|
|
|
|
UINT uMsg,
|
|
|
|
WPARAM wParam,
|
1999-07-27 18:20:36 +02:00
|
|
|
LPARAM lParam,
|
|
|
|
LRESULT *pret)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-11-12 02:02:27 +01:00
|
|
|
LRESULT lres;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2022-02-09 09:25:26 +01:00
|
|
|
TRACE("(%p)->(0x%08x 0x%08x 0x%08Ix 0x%08Ix %p)\n", This, id, uMsg, wParam, lParam, pret);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
1999-11-12 02:02:27 +01:00
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FCW_TOOLBAR:
|
|
|
|
lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("ctrl id: %x\n", id);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
if (pret) *pret = lres;
|
|
|
|
return S_OK;
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_SetMenuSB
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
|
2002-06-01 01:06:46 +02:00
|
|
|
HMENU hmenuShared,
|
1999-07-27 18:20:36 +02:00
|
|
|
HOLEMENU holemenuReserved,
|
|
|
|
HWND hwndActiveObject)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_SetStatusTextSB
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
LPCOLESTR lpszStatusText)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_SetToolbarItems
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
|
2002-06-01 01:06:46 +02:00
|
|
|
LPTBBUTTON lpButtons,
|
|
|
|
UINT nButtons,
|
1999-07-27 18:20:36 +02:00
|
|
|
UINT uFlags)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_TranslateAcceleratorSB
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
|
2002-06-01 01:06:46 +02:00
|
|
|
LPMSG lpmsg,
|
1999-07-27 18:20:36 +02:00
|
|
|
WORD wID)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Feature not implemented */
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2005-05-27 22:17:35 +02:00
|
|
|
static const IShellBrowserVtbl IShellBrowserImpl_Vtbl =
|
2000-11-01 02:50:21 +01:00
|
|
|
{
|
|
|
|
/* IUnknown */
|
|
|
|
IShellBrowserImpl_QueryInterface,
|
|
|
|
IShellBrowserImpl_AddRef,
|
|
|
|
IShellBrowserImpl_Release,
|
|
|
|
/* IOleWindow */
|
|
|
|
IShellBrowserImpl_GetWindow,
|
|
|
|
IShellBrowserImpl_ContextSensitiveHelp,
|
|
|
|
/* IShellBrowser */
|
|
|
|
IShellBrowserImpl_InsertMenusSB,
|
|
|
|
IShellBrowserImpl_SetMenuSB,
|
|
|
|
IShellBrowserImpl_RemoveMenusSB,
|
|
|
|
IShellBrowserImpl_SetStatusTextSB,
|
|
|
|
IShellBrowserImpl_EnableModelessSB,
|
|
|
|
IShellBrowserImpl_TranslateAcceleratorSB,
|
|
|
|
IShellBrowserImpl_BrowseObject,
|
|
|
|
IShellBrowserImpl_GetViewStateStream,
|
|
|
|
IShellBrowserImpl_GetControlWindow,
|
|
|
|
IShellBrowserImpl_SendControlMsg,
|
|
|
|
IShellBrowserImpl_QueryActiveShellView,
|
|
|
|
IShellBrowserImpl_OnViewWindowActive,
|
|
|
|
IShellBrowserImpl_SetToolbarItems
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/*
|
|
|
|
* ICommDlgBrowser
|
|
|
|
*/
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* IShellBrowserImpl_ICommDlgBrowser_QueryInterface
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
|
2000-11-01 02:50:21 +01:00
|
|
|
ICommDlgBrowser *iface,
|
2002-06-01 01:06:46 +02:00
|
|
|
REFIID riid,
|
2000-11-01 02:50:21 +01:00
|
|
|
LPVOID *ppvObj)
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
return IShellBrowserImpl_QueryInterface(&This->IShellBrowser_iface,riid,ppvObj);
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_ICommDlgBrowser_AddRef
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface)
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
return IShellBrowserImpl_AddRef(&This->IShellBrowser_iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_ICommDlgBrowser_Release
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface)
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
return IShellBrowserImpl_Release(&This->IShellBrowser_iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
2005-06-28 21:19:07 +02:00
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand
|
|
|
|
*
|
|
|
|
* Called when a user double-clicks in the view or presses the ENTER key
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser *iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
IShellView *ppshv)
|
|
|
|
{
|
|
|
|
LPITEMIDLIST pidl;
|
|
|
|
FileOpenDlgInfos *fodInfos;
|
|
|
|
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2017-02-21 13:35:17 +01:00
|
|
|
fodInfos = get_filedlg_infoptr(This->hwndOwner);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2005-03-23 14:15:18 +01:00
|
|
|
/* If the selected object is not a folder, send an IDOK command to parent window */
|
2000-06-02 21:36:53 +02:00
|
|
|
if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1)))
|
1999-07-27 18:20:36 +02:00
|
|
|
{
|
|
|
|
HRESULT hRes;
|
|
|
|
|
|
|
|
ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
|
2003-09-02 03:01:06 +02:00
|
|
|
IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, (LPCITEMIDLIST *)&pidl, &ulAttr);
|
2000-06-02 21:36:53 +02:00
|
|
|
if (ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER) )
|
|
|
|
{
|
2010-12-31 11:13:44 +01:00
|
|
|
hRes = IShellBrowser_BrowseObject(&This->IShellBrowser_iface,pidl,SBSP_RELATIVE);
|
|
|
|
if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
|
|
|
|
SendCustomDlgNotificationMessage(This->hwndOwner, CDN_FOLDERCHANGE);
|
2000-06-02 21:36:53 +02:00
|
|
|
}
|
1999-07-27 18:20:36 +02:00
|
|
|
else
|
1999-08-21 16:47:28 +02:00
|
|
|
{
|
2000-06-02 21:36:53 +02:00
|
|
|
/* Tell the dialog that the user selected a file */
|
2005-05-12 11:56:17 +02:00
|
|
|
PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L);
|
|
|
|
hRes = S_OK;
|
1999-08-21 16:47:28 +02:00
|
|
|
}
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2018-03-21 06:59:42 +01:00
|
|
|
ILFree(pidl);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
return hRes;
|
|
|
|
}
|
|
|
|
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2010-12-31 11:12:19 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_OnSelChange
|
|
|
|
*/
|
|
|
|
static HRESULT IShellBrowserImpl_OnSelChange(IShellBrowserImpl *This, const IShellView *ppshv)
|
|
|
|
{
|
|
|
|
FileOpenDlgInfos *fodInfos;
|
|
|
|
|
2017-02-21 13:35:17 +01:00
|
|
|
fodInfos = get_filedlg_infoptr(This->hwndOwner);
|
2010-12-31 11:12:19 +01:00
|
|
|
TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
|
|
|
|
|
|
|
|
/* release old selections */
|
|
|
|
if (fodInfos->Shell.FOIDataObject)
|
|
|
|
IDataObject_Release(fodInfos->Shell.FOIDataObject);
|
|
|
|
|
|
|
|
/* get a new DataObject from the ShellView */
|
|
|
|
if(FAILED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_SELECTION,
|
|
|
|
&IID_IDataObject, (void**)&fodInfos->Shell.FOIDataObject)))
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
FILEDLG95_FILENAME_FillFromSelection(This->hwndOwner);
|
|
|
|
|
|
|
|
if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
|
|
|
|
SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_ICommDlgBrowser_OnStateChange
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
IShellView *ppshv,
|
|
|
|
ULONG uChange)
|
|
|
|
{
|
|
|
|
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2000-06-16 23:51:33 +02:00
|
|
|
TRACE("(%p shv=%p)\n", This, ppshv);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
switch (uChange)
|
|
|
|
{
|
|
|
|
case CDBOSC_SETFOCUS:
|
2000-06-02 21:36:53 +02:00
|
|
|
/* FIXME: Reset the default button.
|
|
|
|
This should be taken care of by defdlg. If control
|
|
|
|
other than button receives focus the default button
|
|
|
|
should be restored. */
|
|
|
|
SendMessageA(This->hwndOwner, DM_SETDEFID, IDOK, 0);
|
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
case CDBOSC_KILLFOCUS:
|
1999-09-03 18:46:41 +02:00
|
|
|
{
|
2017-02-21 13:35:17 +01:00
|
|
|
FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(This->hwndOwner);
|
1999-09-03 18:46:41 +02:00
|
|
|
if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
|
2006-10-03 10:41:09 +02:00
|
|
|
{
|
|
|
|
WCHAR szSave[16];
|
2018-03-20 08:37:49 +01:00
|
|
|
LoadStringW(COMDLG32_hInstance, IDS_SAVE_BUTTON, szSave, ARRAY_SIZE(szSave));
|
2006-10-03 10:41:09 +02:00
|
|
|
SetDlgItemTextW(fodInfos->ShellInfos.hwndOwner, IDOK, szSave);
|
|
|
|
}
|
1999-09-03 18:46:41 +02:00
|
|
|
}
|
1999-07-27 18:20:36 +02:00
|
|
|
break;
|
|
|
|
case CDBOSC_SELCHANGE:
|
2010-12-31 11:12:19 +01:00
|
|
|
return IShellBrowserImpl_OnSelChange(This, ppshv);
|
1999-07-27 18:20:36 +02:00
|
|
|
case CDBOSC_RENAME:
|
2000-06-02 21:36:53 +02:00
|
|
|
/* nothing to do */
|
1999-07-27 18:20:36 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
return NOERROR;
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
2000-04-23 22:40:23 +02:00
|
|
|
|
2009-03-13 01:58:35 +01:00
|
|
|
/* send_includeitem_notification
|
|
|
|
*
|
|
|
|
* Sends a CDN_INCLUDEITEM notification for "pidl" to hwndParentDlg
|
|
|
|
*/
|
|
|
|
static LRESULT send_includeitem_notification(HWND hwndParentDlg, LPCITEMIDLIST pidl)
|
|
|
|
{
|
|
|
|
LRESULT hook_result = 0;
|
2017-02-21 13:35:17 +01:00
|
|
|
FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwndParentDlg);
|
2009-03-13 01:58:35 +01:00
|
|
|
|
|
|
|
if(!fodInfos) return 0;
|
|
|
|
|
|
|
|
if(fodInfos->DlgInfos.hwndCustomDlg)
|
|
|
|
{
|
|
|
|
TRACE("call notify CDN_INCLUDEITEM for pidl=%p\n", pidl);
|
|
|
|
if(fodInfos->unicode)
|
|
|
|
{
|
|
|
|
OFNOTIFYEXW ofnNotify;
|
|
|
|
ofnNotify.psf = fodInfos->Shell.FOIShellFolder;
|
|
|
|
ofnNotify.pidl = (LPITEMIDLIST)pidl;
|
|
|
|
ofnNotify.hdr.hwndFrom = hwndParentDlg;
|
|
|
|
ofnNotify.hdr.idFrom = 0;
|
|
|
|
ofnNotify.hdr.code = CDN_INCLUDEITEM;
|
|
|
|
ofnNotify.lpOFN = fodInfos->ofnInfos;
|
|
|
|
hook_result = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
OFNOTIFYEXA ofnNotify;
|
|
|
|
ofnNotify.psf = fodInfos->Shell.FOIShellFolder;
|
|
|
|
ofnNotify.pidl = (LPITEMIDLIST)pidl;
|
|
|
|
ofnNotify.hdr.hwndFrom = hwndParentDlg;
|
|
|
|
ofnNotify.hdr.idFrom = 0;
|
|
|
|
ofnNotify.hdr.code = CDN_INCLUDEITEM;
|
|
|
|
ofnNotify.lpOFN = (LPOPENFILENAMEA)fodInfos->ofnInfos;
|
|
|
|
hook_result = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
|
|
|
|
}
|
|
|
|
}
|
2022-02-09 09:25:26 +01:00
|
|
|
TRACE("Retval: 0x%08Ix\n", hook_result);
|
2009-03-13 01:58:35 +01:00
|
|
|
return hook_result;
|
|
|
|
}
|
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_ICommDlgBrowser_IncludeObject
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface,
|
1999-07-27 18:20:36 +02:00
|
|
|
IShellView * ppshv,
|
|
|
|
LPCITEMIDLIST pidl)
|
|
|
|
{
|
|
|
|
FileOpenDlgInfos *fodInfos;
|
|
|
|
ULONG ulAttr;
|
|
|
|
STRRET str;
|
1999-07-28 18:38:45 +02:00
|
|
|
WCHAR szPathW[MAX_PATH];
|
1999-07-27 18:20:36 +02:00
|
|
|
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2017-02-21 13:35:17 +01:00
|
|
|
fodInfos = get_filedlg_infoptr(This->hwndOwner);
|
1999-07-27 18:20:36 +02:00
|
|
|
|
|
|
|
ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK;
|
|
|
|
IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2007-11-22 22:34:55 +01:00
|
|
|
if( (ulAttr & SFGAO_HIDDEN) || /* hidden */
|
|
|
|
!(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */
|
1999-07-27 18:20:36 +02:00
|
|
|
return S_FALSE;
|
2000-06-02 21:36:53 +02:00
|
|
|
|
2001-11-06 22:01:32 +01:00
|
|
|
/* always include directories and links */
|
2002-06-01 01:06:46 +02:00
|
|
|
if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
|
1999-07-27 18:20:36 +02:00
|
|
|
return S_OK;
|
2000-06-02 21:36:53 +02:00
|
|
|
|
2009-03-13 01:58:35 +01:00
|
|
|
/* if the application takes care of including the item we are done */
|
|
|
|
if(fodInfos->ofnInfos->Flags & OFN_ENABLEINCLUDENOTIFY &&
|
|
|
|
send_includeitem_notification(This->hwndOwner, pidl))
|
|
|
|
return S_OK;
|
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
/* Check if there is a mask to apply if not */
|
2014-11-18 10:18:20 +01:00
|
|
|
if(!fodInfos->ShellInfos.lpstrCurrentFilter || !fodInfos->ShellInfos.lpstrCurrentFilter[0])
|
1999-07-27 18:20:36 +02:00
|
|
|
return S_OK;
|
1999-07-28 18:38:45 +02:00
|
|
|
|
2000-06-02 21:36:53 +02:00
|
|
|
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING, &str)))
|
|
|
|
{
|
2009-01-22 23:39:19 +01:00
|
|
|
if (COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl))
|
1999-07-28 18:38:45 +02:00
|
|
|
{
|
2001-01-17 23:05:24 +01:00
|
|
|
if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
|
1999-07-28 18:38:45 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return S_FALSE;
|
|
|
|
|
1999-07-27 18:20:36 +02:00
|
|
|
}
|
|
|
|
|
2005-05-27 22:17:35 +02:00
|
|
|
static const ICommDlgBrowserVtbl IShellBrowserImpl_ICommDlgBrowser_Vtbl =
|
2000-11-01 02:50:21 +01:00
|
|
|
{
|
|
|
|
/* IUnknown */
|
|
|
|
IShellBrowserImpl_ICommDlgBrowser_QueryInterface,
|
|
|
|
IShellBrowserImpl_ICommDlgBrowser_AddRef,
|
|
|
|
IShellBrowserImpl_ICommDlgBrowser_Release,
|
|
|
|
/* ICommDlgBrowser */
|
|
|
|
IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand,
|
|
|
|
IShellBrowserImpl_ICommDlgBrowser_OnStateChange,
|
|
|
|
IShellBrowserImpl_ICommDlgBrowser_IncludeObject
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IServiceProvider
|
|
|
|
*/
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* IShellBrowserImpl_IServiceProvider_QueryInterface
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
|
2000-11-01 02:50:21 +01:00
|
|
|
IServiceProvider *iface,
|
2002-06-01 01:06:46 +02:00
|
|
|
REFIID riid,
|
2000-11-01 02:50:21 +01:00
|
|
|
LPVOID *ppvObj)
|
|
|
|
{
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
|
2000-11-01 02:50:21 +01:00
|
|
|
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
return IShellBrowserImpl_QueryInterface(&This->IShellBrowser_iface,riid,ppvObj);
|
2000-11-01 02:50:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_IServiceProvider_AddRef
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider * iface)
|
2000-11-01 02:50:21 +01:00
|
|
|
{
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
|
2000-11-01 02:50:21 +01:00
|
|
|
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
return IShellBrowserImpl_AddRef(&This->IShellBrowser_iface);
|
2000-11-01 02:50:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_IServiceProvider_Release
|
|
|
|
*/
|
2005-06-28 21:19:07 +02:00
|
|
|
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface)
|
2000-11-01 02:50:21 +01:00
|
|
|
{
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
|
2000-11-01 02:50:21 +01:00
|
|
|
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
|
2010-12-31 11:13:44 +01:00
|
|
|
return IShellBrowserImpl_Release(&This->IShellBrowser_iface);
|
2000-11-01 02:50:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellBrowserImpl_IServiceProvider_Release
|
|
|
|
*
|
|
|
|
* NOTES
|
2002-07-02 04:05:17 +02:00
|
|
|
* the w2k shellview asks for (guidService = SID_STopLevelBrowser,
|
|
|
|
* riid = IShellBrowser) to call SendControlMsg ().
|
2000-11-01 02:50:21 +01:00
|
|
|
*
|
|
|
|
* FIXME
|
|
|
|
* this is a hack!
|
|
|
|
*/
|
|
|
|
|
2005-06-28 21:19:07 +02:00
|
|
|
static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryService(
|
2000-11-01 02:50:21 +01:00
|
|
|
IServiceProvider * iface,
|
|
|
|
REFGUID guidService,
|
|
|
|
REFIID riid,
|
|
|
|
void** ppv)
|
|
|
|
{
|
2005-07-27 13:10:52 +02:00
|
|
|
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
|
2000-11-01 02:50:21 +01:00
|
|
|
|
|
|
|
FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
|
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser))
|
2010-12-31 11:13:44 +01:00
|
|
|
return IShellBrowserImpl_QueryInterface(&This->IShellBrowser_iface,riid,ppv);
|
|
|
|
|
2000-11-01 02:50:21 +01:00
|
|
|
FIXME("(%p) unknown interface requested\n", This);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2005-05-27 22:17:35 +02:00
|
|
|
static const IServiceProviderVtbl IShellBrowserImpl_IServiceProvider_Vtbl =
|
2000-11-01 02:50:21 +01:00
|
|
|
{
|
|
|
|
/* IUnknown */
|
|
|
|
IShellBrowserImpl_IServiceProvider_QueryInterface,
|
|
|
|
IShellBrowserImpl_IServiceProvider_AddRef,
|
|
|
|
IShellBrowserImpl_IServiceProvider_Release,
|
|
|
|
/* IServiceProvider */
|
|
|
|
IShellBrowserImpl_IServiceProvider_QueryService
|
|
|
|
};
|