2 * ExplorerBrowser Control implementation.
4 * Copyright 2010 David Hedberg
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
31 #include "wine/list.h"
32 #include "wine/debug.h"
35 #include "shell32_main.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(shell);
40 typedef struct _event_client {
42 IExplorerBrowserEvents *pebe;
46 typedef struct _ExplorerBrowserImpl {
47 const IExplorerBrowserVtbl *lpVtbl;
48 const IShellBrowserVtbl *lpsbVtbl;
55 EXPLORER_BROWSER_OPTIONS eb_options;
58 struct list event_clients;
59 DWORD events_next_cookie;
63 LPITEMIDLIST current_pidl;
64 } ExplorerBrowserImpl;
66 /**************************************************************************
69 static void events_unadvise_all(ExplorerBrowserImpl *This)
71 event_client *client, *curs;
74 LIST_FOR_EACH_ENTRY_SAFE(client, curs, &This->event_clients, event_client, entry)
76 TRACE("Removing %p\n", client);
77 list_remove(&client->entry);
78 IExplorerBrowserEvents_Release(client->pebe);
79 HeapFree(GetProcessHeap(), 0, client);
83 static HRESULT events_NavigationPending(ExplorerBrowserImpl *This, PCIDLIST_ABSOLUTE pidl)
90 LIST_FOR_EACH_ENTRY(cursor, &This->event_clients, event_client, entry)
92 TRACE("Notifying %p\n", cursor);
93 hres = IExplorerBrowserEvents_OnNavigationPending(cursor->pebe, pidl);
95 /* If this failed for any reason, the browsing is supposed to be aborted. */
103 static void events_NavigationComplete(ExplorerBrowserImpl *This, PCIDLIST_ABSOLUTE pidl)
105 event_client *cursor;
109 LIST_FOR_EACH_ENTRY(cursor, &This->event_clients, event_client, entry)
111 TRACE("Notifying %p\n", cursor);
112 IExplorerBrowserEvents_OnNavigationComplete(cursor->pebe, pidl);
116 static void events_NavigationFailed(ExplorerBrowserImpl *This, PCIDLIST_ABSOLUTE pidl)
118 event_client *cursor;
122 LIST_FOR_EACH_ENTRY(cursor, &This->event_clients, event_client, entry)
124 TRACE("Notifying %p\n", cursor);
125 IExplorerBrowserEvents_OnNavigationFailed(cursor->pebe, pidl);
129 static void events_ViewCreated(ExplorerBrowserImpl *This, IShellView *psv)
131 event_client *cursor;
135 LIST_FOR_EACH_ENTRY(cursor, &This->event_clients, event_client, entry)
137 TRACE("Notifying %p\n", cursor);
138 IExplorerBrowserEvents_OnViewCreated(cursor->pebe, psv);
142 /**************************************************************************
145 static void update_layout(ExplorerBrowserImpl *This)
150 GetClientRect(This->hwnd_main, &rc);
151 CopyRect(&This->sv_rc, &rc);
154 static void size_panes(ExplorerBrowserImpl *This)
156 MoveWindow(This->hwnd_sv,
157 This->sv_rc.left, This->sv_rc.top,
158 This->sv_rc.right - This->sv_rc.left, This->sv_rc.bottom - This->sv_rc.top,
162 static HRESULT change_viewmode(ExplorerBrowserImpl *This, UINT viewmode)
170 hr = IShellView_QueryInterface(This->psv, &IID_IFolderView, (void*)&pfv);
173 hr = IFolderView_SetCurrentViewMode(pfv, This->fs.ViewMode);
174 IFolderView_Release(pfv);
180 static HRESULT create_new_shellview(ExplorerBrowserImpl *This, IShellItem *psi)
182 IShellBrowser *psb = (IShellBrowser*)&This->lpsbVtbl;
188 TRACE("%p, %p\n", This, psi);
190 hr = IShellItem_BindToHandler(psi, NULL, &BHID_SFObject, &IID_IShellFolder, (void**)&psf);
193 hr = IShellFolder_CreateViewObject(psf, This->hwnd_main, &IID_IShellView, (void**)&psv);
198 IShellView_DestroyViewWindow(This->psv);
199 This->hwnd_sv = NULL;
202 hr = IShellView_CreateViewWindow(psv, This->psv, &This->fs, psb, &This->sv_rc, &hwnd_new);
205 /* Replace the old shellview */
206 if(This->psv) IShellView_Release(This->psv);
209 This->hwnd_sv = hwnd_new;
210 events_ViewCreated(This, psv);
214 ERR("CreateViewWindow failed (0x%x)\n", hr);
215 IShellView_Release(psv);
219 ERR("CreateViewObject failed (0x%x)\n", hr);
221 IShellFolder_Release(psf);
224 ERR("SI::BindToHandler failed (0x%x)\n", hr);
229 /**************************************************************************
230 * Main window related functions.
232 static LRESULT main_on_wm_create(HWND hWnd, CREATESTRUCTW *crs)
234 ExplorerBrowserImpl *This = crs->lpCreateParams;
237 SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LPARAM)This);
238 This->hwnd_main = hWnd;
243 static LRESULT main_on_wm_size(ExplorerBrowserImpl *This)
251 static LRESULT CALLBACK main_wndproc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
253 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)GetWindowLongPtrW(hWnd, GWLP_USERDATA);
257 case WM_CREATE: return main_on_wm_create(hWnd, (CREATESTRUCTW*)lParam);
258 case WM_SIZE: return main_on_wm_size(This);
259 default: return DefWindowProcW(hWnd, uMessage, wParam, lParam);
265 /**************************************************************************
266 * IExplorerBrowser Implementation
268 static HRESULT WINAPI IExplorerBrowser_fnQueryInterface(IExplorerBrowser *iface,
269 REFIID riid, void **ppvObject)
271 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
272 TRACE("%p (%s, %p)\n", This, shdebugstr_guid(riid), ppvObject);
275 if(IsEqualIID(riid, &IID_IExplorerBrowser) ||
276 IsEqualIID(riid, &IID_IUnknown))
280 else if(IsEqualIID(riid, &IID_IShellBrowser))
282 *ppvObject = &This->lpsbVtbl;
287 IUnknown_AddRef((IUnknown*)*ppvObject);
291 return E_NOINTERFACE;
294 static ULONG WINAPI IExplorerBrowser_fnAddRef(IExplorerBrowser *iface)
296 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
297 LONG ref = InterlockedIncrement(&This->ref);
298 TRACE("%p - ref %d\n", This, ref);
303 static ULONG WINAPI IExplorerBrowser_fnRelease(IExplorerBrowser *iface)
305 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
306 LONG ref = InterlockedDecrement(&This->ref);
307 TRACE("%p - ref %d\n", This, ref);
314 IExplorerBrowser_Destroy(iface);
316 HeapFree(GetProcessHeap(), 0, This);
323 static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface,
324 HWND hwndParent, const RECT *prc,
325 const FOLDERSETTINGS *pfs)
327 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
330 static const WCHAR EB_CLASS_NAME[] =
331 {'E','x','p','l','o','r','e','r','B','r','o','w','s','e','r','C','o','n','t','r','o','l',0};
333 TRACE("%p (%p, %p, %p)\n", This, hwndParent, prc, pfs);
341 if( !GetClassInfoW(shell32_hInstance, EB_CLASS_NAME, &wc) )
343 wc.style = CS_HREDRAW | CS_VREDRAW;
344 wc.lpfnWndProc = main_wndproc;
347 wc.hInstance = shell32_hInstance;
349 wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
350 wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
351 wc.lpszMenuName = NULL;
352 wc.lpszClassName = EB_CLASS_NAME;
354 if (!RegisterClassW(&wc)) return E_FAIL;
357 style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_BORDER;
358 This->hwnd_main = CreateWindowExW(WS_EX_CONTROLPARENT, EB_CLASS_NAME, NULL, style,
360 prc->right - prc->left, prc->bottom - prc->top,
361 hwndParent, 0, shell32_hInstance, This);
365 ERR("Failed to create the window.\n");
369 This->fs.ViewMode = pfs ? pfs->ViewMode : FVM_DETAILS;
370 This->fs.fFlags = pfs ? (pfs->fFlags | FWF_NOCLIENTEDGE) : FWF_NOCLIENTEDGE;
375 static HRESULT WINAPI IExplorerBrowser_fnDestroy(IExplorerBrowser *iface)
377 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
382 IShellView_DestroyViewWindow(This->psv);
383 IShellView_Release(This->psv);
385 This->hwnd_sv = NULL;
388 events_unadvise_all(This);
390 ILFree(This->current_pidl);
391 This->current_pidl = NULL;
393 DestroyWindow(This->hwnd_main);
394 This->destroyed = TRUE;
399 static HRESULT WINAPI IExplorerBrowser_fnSetRect(IExplorerBrowser *iface,
400 HDWP *phdwp, RECT rcBrowser)
402 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
403 TRACE("%p (%p, %s)\n", This, phdwp, wine_dbgstr_rect(&rcBrowser));
407 *phdwp = DeferWindowPos(*phdwp, This->hwnd_main, NULL, rcBrowser.left, rcBrowser.top,
408 rcBrowser.right - rcBrowser.left, rcBrowser.bottom - rcBrowser.top,
409 SWP_NOZORDER | SWP_NOACTIVATE);
413 MoveWindow(This->hwnd_main, rcBrowser.left, rcBrowser.top,
414 rcBrowser.right - rcBrowser.left, rcBrowser.bottom - rcBrowser.top, TRUE);
420 static HRESULT WINAPI IExplorerBrowser_fnSetPropertyBag(IExplorerBrowser *iface,
421 LPCWSTR pszPropertyBag)
423 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
424 FIXME("stub, %p (%s)\n", This, debugstr_w(pszPropertyBag));
429 static HRESULT WINAPI IExplorerBrowser_fnSetEmptyText(IExplorerBrowser *iface,
430 LPCWSTR pszEmptyText)
432 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
433 FIXME("stub, %p (%s)\n", This, debugstr_w(pszEmptyText));
438 static HRESULT WINAPI IExplorerBrowser_fnSetFolderSettings(IExplorerBrowser *iface,
439 const FOLDERSETTINGS *pfs)
441 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
442 TRACE("%p (%p)\n", This, pfs);
447 This->fs.ViewMode = pfs->ViewMode;
448 This->fs.fFlags = pfs->fFlags | FWF_NOCLIENTEDGE;
450 /* Change the settings of the current view, if any. */
451 return change_viewmode(This, This->fs.ViewMode);
454 static HRESULT WINAPI IExplorerBrowser_fnAdvise(IExplorerBrowser *iface,
455 IExplorerBrowserEvents *psbe,
458 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
459 event_client *client;
460 TRACE("%p (%p, %p)\n", This, psbe, pdwCookie);
462 client = HeapAlloc(GetProcessHeap(), 0, sizeof(event_client));
464 client->cookie = ++This->events_next_cookie;
466 IExplorerBrowserEvents_AddRef(psbe);
467 *pdwCookie = client->cookie;
469 list_add_tail(&This->event_clients, &client->entry);
474 static HRESULT WINAPI IExplorerBrowser_fnUnadvise(IExplorerBrowser *iface,
477 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
478 event_client *client;
479 TRACE("%p (0x%x)\n", This, dwCookie);
481 LIST_FOR_EACH_ENTRY(client, &This->event_clients, event_client, entry)
483 if(client->cookie == dwCookie)
485 list_remove(&client->entry);
486 IExplorerBrowserEvents_Release(client->pebe);
487 HeapFree(GetProcessHeap(), 0, client);
495 static HRESULT WINAPI IExplorerBrowser_fnSetOptions(IExplorerBrowser *iface,
496 EXPLORER_BROWSER_OPTIONS dwFlag)
498 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
499 static const EXPLORER_BROWSER_OPTIONS unsupported_options =
500 EBO_SHOWFRAMES | EBO_ALWAYSNAVIGATE | EBO_NOWRAPPERWINDOW | EBO_HTMLSHAREPOINTVIEW;
502 TRACE("%p (0x%x)\n", This, dwFlag);
504 if(dwFlag & unsupported_options)
505 FIXME("Flags 0x%08x contains unsupported options.\n", dwFlag);
507 This->eb_options = dwFlag;
512 static HRESULT WINAPI IExplorerBrowser_fnGetOptions(IExplorerBrowser *iface,
513 EXPLORER_BROWSER_OPTIONS *pdwFlag)
515 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
516 TRACE("%p (%p)\n", This, pdwFlag);
518 *pdwFlag = This->eb_options;
523 static const UINT unsupported_browse_flags =
524 SBSP_NAVIGATEBACK | SBSP_NAVIGATEFORWARD | SBSP_NEWBROWSER |
525 EBF_SELECTFROMDATAOBJECT | EBF_NODROPTARGET;
526 static HRESULT WINAPI IExplorerBrowser_fnBrowseToIDList(IExplorerBrowser *iface,
527 PCUIDLIST_RELATIVE pidl,
530 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
531 LPITEMIDLIST absolute_pidl = NULL;
533 TRACE("%p (%p, 0x%x)\n", This, pidl, uFlags);
539 return HRESULT_FROM_WIN32(ERROR_BUSY);
541 if(This->current_pidl && (This->eb_options & EBO_NAVIGATEONCE))
544 if(uFlags & SBSP_EXPLOREMODE)
547 if(uFlags & unsupported_browse_flags)
548 FIXME("Argument 0x%x contains unsupported flags.\n", uFlags);
550 if(uFlags & SBSP_PARENT)
552 if(This->current_pidl)
554 if(_ILIsPidlSimple(This->current_pidl))
556 absolute_pidl = _ILCreateDesktop();
560 absolute_pidl = ILClone(This->current_pidl);
561 ILRemoveLastID(absolute_pidl);
566 ERR("Failed to get parent pidl.\n");
571 else if(uFlags & SBSP_RELATIVE)
573 /* SBSP_RELATIVE has precedence over SBSP_ABSOLUTE */
574 TRACE("SBSP_RELATIVE\n");
575 if(This->current_pidl)
577 absolute_pidl = ILCombine(This->current_pidl, pidl);
581 ERR("Failed to get absolute pidl.\n");
587 TRACE("SBSP_ABSOLUTE\n");
588 absolute_pidl = ILClone(pidl);
589 if(!absolute_pidl && !This->current_pidl)
591 else if(!absolute_pidl)
595 /* TODO: Asynchronous browsing. Return S_OK here and finish in
598 hr = events_NavigationPending(This, absolute_pidl);
601 TRACE("Browsing aborted.\n");
602 ILFree(absolute_pidl);
606 /* Only browse if the new pidl differs from the old */
607 if(!ILIsEqual(This->current_pidl, absolute_pidl))
610 hr = SHCreateItemFromIDList(absolute_pidl, &IID_IShellItem, (void**)&psi);
613 hr = create_new_shellview(This, psi);
616 events_NavigationFailed(This, absolute_pidl);
617 ILFree(absolute_pidl);
618 IShellItem_Release(psi);
621 IShellItem_Release(psi);
625 events_NavigationComplete(This, absolute_pidl);
626 ILFree(This->current_pidl);
627 This->current_pidl = absolute_pidl;
632 static HRESULT WINAPI IExplorerBrowser_fnBrowseToObject(IExplorerBrowser *iface,
633 IUnknown *punk, UINT uFlags)
635 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
636 FIXME("stub, %p (%p, 0x%x)\n", This, punk, uFlags);
641 static HRESULT WINAPI IExplorerBrowser_fnFillFromObject(IExplorerBrowser *iface,
643 EXPLORER_BROWSER_FILL_FLAGS dwFlags)
645 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
646 FIXME("stub, %p (%p, 0x%x)\n", This, punk, dwFlags);
651 static HRESULT WINAPI IExplorerBrowser_fnRemoveAll(IExplorerBrowser *iface)
653 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
654 FIXME("stub, %p\n", This);
659 static HRESULT WINAPI IExplorerBrowser_fnGetCurrentView(IExplorerBrowser *iface,
660 REFIID riid, void **ppv)
662 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
663 TRACE("%p (%s, %p)\n", This, shdebugstr_guid(riid), ppv);
668 return IShellView_QueryInterface(This->psv, riid, ppv);
671 static const IExplorerBrowserVtbl vt_IExplorerBrowser =
673 IExplorerBrowser_fnQueryInterface,
674 IExplorerBrowser_fnAddRef,
675 IExplorerBrowser_fnRelease,
676 IExplorerBrowser_fnInitialize,
677 IExplorerBrowser_fnDestroy,
678 IExplorerBrowser_fnSetRect,
679 IExplorerBrowser_fnSetPropertyBag,
680 IExplorerBrowser_fnSetEmptyText,
681 IExplorerBrowser_fnSetFolderSettings,
682 IExplorerBrowser_fnAdvise,
683 IExplorerBrowser_fnUnadvise,
684 IExplorerBrowser_fnSetOptions,
685 IExplorerBrowser_fnGetOptions,
686 IExplorerBrowser_fnBrowseToIDList,
687 IExplorerBrowser_fnBrowseToObject,
688 IExplorerBrowser_fnFillFromObject,
689 IExplorerBrowser_fnRemoveAll,
690 IExplorerBrowser_fnGetCurrentView
693 /**************************************************************************
694 * IShellBrowser Implementation
697 static inline ExplorerBrowserImpl *impl_from_IShellBrowser(IShellBrowser *iface)
699 return (ExplorerBrowserImpl *)((char*)iface - FIELD_OFFSET(ExplorerBrowserImpl, lpsbVtbl));
702 static HRESULT WINAPI IShellBrowser_fnQueryInterface(IShellBrowser *iface,
703 REFIID riid, void **ppvObject)
705 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
707 return IUnknown_QueryInterface((IUnknown*) This, riid, ppvObject);
710 static ULONG WINAPI IShellBrowser_fnAddRef(IShellBrowser *iface)
712 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
714 return IUnknown_AddRef((IUnknown*) This);
717 static ULONG WINAPI IShellBrowser_fnRelease(IShellBrowser *iface)
719 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
721 return IUnknown_Release((IUnknown*) This);
724 static HRESULT WINAPI IShellBrowser_fnGetWindow(IShellBrowser *iface, HWND *phwnd)
726 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
727 TRACE("%p (%p)\n", This, phwnd);
732 *phwnd = This->hwnd_main;
736 static HRESULT WINAPI IShellBrowser_fnContextSensitiveHelp(IShellBrowser *iface,
739 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
740 FIXME("stub, %p (%d)\n", This, fEnterMode);
745 static HRESULT WINAPI IShellBrowser_fnInsertMenusSB(IShellBrowser *iface,
747 LPOLEMENUGROUPWIDTHS lpMenuWidths)
749 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
750 TRACE("%p (%p, %p)\n", This, hmenuShared, lpMenuWidths);
752 /* Not implemented. */
756 static HRESULT WINAPI IShellBrowser_fnSetMenuSB(IShellBrowser *iface,
758 HOLEMENU holemenuReserved,
759 HWND hwndActiveObject)
761 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
762 TRACE("%p (%p, %p, %p)\n", This, hmenuShared, holemenuReserved, hwndActiveObject);
764 /* Not implemented. */
768 static HRESULT WINAPI IShellBrowser_fnRemoveMenusSB(IShellBrowser *iface,
771 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
772 TRACE("%p (%p)\n", This, hmenuShared);
774 /* Not implemented. */
778 static HRESULT WINAPI IShellBrowser_fnSetStatusTextSB(IShellBrowser *iface,
779 LPCOLESTR pszStatusText)
781 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
782 FIXME("stub, %p (%s)\n", This, debugstr_w(pszStatusText));
787 static HRESULT WINAPI IShellBrowser_fnEnableModelessSB(IShellBrowser *iface,
790 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
791 FIXME("stub, %p (%d)\n", This, fEnable);
796 static HRESULT WINAPI IShellBrowser_fnTranslateAcceleratorSB(IShellBrowser *iface,
799 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
800 FIXME("stub, %p (%p, 0x%x)\n", This, pmsg, wID);
805 static HRESULT WINAPI IShellBrowser_fnBrowseObject(IShellBrowser *iface,
806 LPCITEMIDLIST pidl, UINT wFlags)
808 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
809 TRACE("%p (%p, %x)\n", This, pidl, wFlags);
811 return IExplorerBrowser_fnBrowseToIDList((IExplorerBrowser*)This, pidl, wFlags);
814 static HRESULT WINAPI IShellBrowser_fnGetViewStateStream(IShellBrowser *iface,
818 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
819 FIXME("stub, %p (0x%x, %p)\n", This, grfMode, ppStrm);
825 static HRESULT WINAPI IShellBrowser_fnGetControlWindow(IShellBrowser *iface,
826 UINT id, HWND *phwnd)
828 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
829 TRACE("%p (%d, %p)\n", This, id, phwnd);
831 /* Not implemented. */
835 static HRESULT WINAPI IShellBrowser_fnSendControlMsg(IShellBrowser *iface,
837 WPARAM wParam, LPARAM lParam,
840 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
841 FIXME("stub, %p (%d, %d, %lx, %lx, %p)\n", This, id, uMsg, wParam, lParam, pret);
846 static HRESULT WINAPI IShellBrowser_fnQueryActiveShellView(IShellBrowser *iface,
849 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
850 TRACE("%p (%p)\n", This, ppshv);
856 IShellView_AddRef(This->psv);
861 static HRESULT WINAPI IShellBrowser_fnOnViewWindowActive(IShellBrowser *iface,
864 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
865 FIXME("stub, %p (%p)\n", This, pshv);
870 static HRESULT WINAPI IShellBrowser_fnSetToolbarItems(IShellBrowser *iface,
871 LPTBBUTTONSB lpButtons,
872 UINT nButtons, UINT uFlags)
874 ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
875 FIXME("stub, %p (%p, %d, 0x%x)\n", This, lpButtons, nButtons, uFlags);
880 static const IShellBrowserVtbl vt_IShellBrowser = {
881 IShellBrowser_fnQueryInterface,
882 IShellBrowser_fnAddRef,
883 IShellBrowser_fnRelease,
884 IShellBrowser_fnGetWindow,
885 IShellBrowser_fnContextSensitiveHelp,
886 IShellBrowser_fnInsertMenusSB,
887 IShellBrowser_fnSetMenuSB,
888 IShellBrowser_fnRemoveMenusSB,
889 IShellBrowser_fnSetStatusTextSB,
890 IShellBrowser_fnEnableModelessSB,
891 IShellBrowser_fnTranslateAcceleratorSB,
892 IShellBrowser_fnBrowseObject,
893 IShellBrowser_fnGetViewStateStream,
894 IShellBrowser_fnGetControlWindow,
895 IShellBrowser_fnSendControlMsg,
896 IShellBrowser_fnQueryActiveShellView,
897 IShellBrowser_fnOnViewWindowActive,
898 IShellBrowser_fnSetToolbarItems
901 HRESULT WINAPI ExplorerBrowser_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv)
903 ExplorerBrowserImpl *eb;
906 TRACE("%p %s %p\n", pUnkOuter, shdebugstr_guid (riid), ppv);
911 return CLASS_E_NOAGGREGATION;
913 eb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ExplorerBrowserImpl));
915 eb->lpVtbl = &vt_IExplorerBrowser;
916 eb->lpsbVtbl = &vt_IShellBrowser;
918 list_init(&eb->event_clients);
920 ret = IExplorerBrowser_QueryInterface((IExplorerBrowser*)eb, riid, ppv);
921 IExplorerBrowser_Release((IExplorerBrowser*)eb);
923 TRACE("--(%p)\n", ppv);