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
30 #include "wine/list.h"
31 #include "wine/debug.h"
34 #include "shell32_main.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(shell
);
39 #define SPLITTER_WIDTH 2
40 #define NP_MIN_WIDTH 60
41 #define SV_MIN_WIDTH 150
43 typedef struct _event_client
{
45 IExplorerBrowserEvents
*pebe
;
49 typedef struct _travellog_entry
{
54 typedef struct _ExplorerBrowserImpl
{
55 IExplorerBrowser IExplorerBrowser_iface
;
56 IShellBrowser IShellBrowser_iface
;
57 ICommDlgBrowser3 ICommDlgBrowser3_iface
;
58 IObjectWithSite IObjectWithSite_iface
;
59 INameSpaceTreeControlEvents INameSpaceTreeControlEvents_iface
;
60 IInputObject IInputObject_iface
;
69 INameSpaceTreeControl2
*pnstc2
;
70 HWND hwnd_splitter
, hwnd_nstc
;
77 EXPLORER_BROWSER_OPTIONS eb_options
;
80 struct list event_clients
;
81 DWORD events_next_cookie
;
82 struct list travellog
;
83 travellog_entry
*travellog_cursor
;
88 LPITEMIDLIST current_pidl
;
91 ICommDlgBrowser
*pcdb_site
;
92 ICommDlgBrowser2
*pcdb2_site
;
93 ICommDlgBrowser3
*pcdb3_site
;
94 IExplorerPaneVisibility
*pepv_site
;
95 } ExplorerBrowserImpl
;
97 static void initialize_navpane(ExplorerBrowserImpl
*This
, HWND hwnd_parent
, RECT
*rc
);
99 /**************************************************************************
102 static void events_unadvise_all(ExplorerBrowserImpl
*This
)
104 event_client
*client
, *curs
;
107 LIST_FOR_EACH_ENTRY_SAFE(client
, curs
, &This
->event_clients
, event_client
, entry
)
109 TRACE("Removing %p\n", client
);
110 list_remove(&client
->entry
);
111 IExplorerBrowserEvents_Release(client
->pebe
);
112 HeapFree(GetProcessHeap(), 0, client
);
116 static HRESULT
events_NavigationPending(ExplorerBrowserImpl
*This
, PCIDLIST_ABSOLUTE pidl
)
118 event_client
*cursor
;
123 LIST_FOR_EACH_ENTRY(cursor
, &This
->event_clients
, event_client
, entry
)
125 TRACE("Notifying %p\n", cursor
);
126 hres
= IExplorerBrowserEvents_OnNavigationPending(cursor
->pebe
, pidl
);
128 /* If this failed for any reason, the browsing is supposed to be aborted. */
136 static void events_NavigationComplete(ExplorerBrowserImpl
*This
, PCIDLIST_ABSOLUTE pidl
)
138 event_client
*cursor
;
142 LIST_FOR_EACH_ENTRY(cursor
, &This
->event_clients
, event_client
, entry
)
144 TRACE("Notifying %p\n", cursor
);
145 IExplorerBrowserEvents_OnNavigationComplete(cursor
->pebe
, pidl
);
149 static void events_NavigationFailed(ExplorerBrowserImpl
*This
, PCIDLIST_ABSOLUTE pidl
)
151 event_client
*cursor
;
155 LIST_FOR_EACH_ENTRY(cursor
, &This
->event_clients
, event_client
, entry
)
157 TRACE("Notifying %p\n", cursor
);
158 IExplorerBrowserEvents_OnNavigationFailed(cursor
->pebe
, pidl
);
162 static void events_ViewCreated(ExplorerBrowserImpl
*This
, IShellView
*psv
)
164 event_client
*cursor
;
168 LIST_FOR_EACH_ENTRY(cursor
, &This
->event_clients
, event_client
, entry
)
170 TRACE("Notifying %p\n", cursor
);
171 IExplorerBrowserEvents_OnViewCreated(cursor
->pebe
, psv
);
175 /**************************************************************************
176 * Travellog functions.
178 static void travellog_remove_entry(ExplorerBrowserImpl
*This
, travellog_entry
*entry
)
180 TRACE("Removing %p\n", entry
);
182 list_remove(&entry
->entry
);
184 HeapFree(GetProcessHeap(), 0, entry
);
185 This
->travellog_count
--;
188 static void travellog_remove_all_entries(ExplorerBrowserImpl
*This
)
190 travellog_entry
*cursor
, *cursor2
;
193 LIST_FOR_EACH_ENTRY_SAFE(cursor
, cursor2
, &This
->travellog
, travellog_entry
, entry
)
194 travellog_remove_entry(This
, cursor
);
196 This
->travellog_cursor
= NULL
;
199 static void travellog_add_entry(ExplorerBrowserImpl
*This
, LPITEMIDLIST pidl
)
201 travellog_entry
*new, *cursor
, *cursor2
;
202 TRACE("%p (old count %d)\n", pidl
, This
->travellog_count
);
204 /* Replace the old tail, if any, with the new entry */
205 if(This
->travellog_cursor
)
207 LIST_FOR_EACH_ENTRY_SAFE_REV(cursor
, cursor2
, &This
->travellog
, travellog_entry
, entry
)
209 if(cursor
== This
->travellog_cursor
)
211 travellog_remove_entry(This
, cursor
);
215 /* Create and add the new entry */
216 new = HeapAlloc(GetProcessHeap(), 0, sizeof(travellog_entry
));
217 new->pidl
= ILClone(pidl
);
218 list_add_tail(&This
->travellog
, &new->entry
);
219 This
->travellog_cursor
= new;
220 This
->travellog_count
++;
222 /* Remove the first few entries if the size limit is reached. */
223 if(This
->travellog_count
> 200)
226 LIST_FOR_EACH_ENTRY_SAFE(cursor
, cursor2
, &This
->travellog
, travellog_entry
, entry
)
230 travellog_remove_entry(This
, cursor
);
235 static LPCITEMIDLIST
travellog_go_back(ExplorerBrowserImpl
*This
)
237 travellog_entry
*prev
;
238 TRACE("%p, %p\n", This
, This
->travellog_cursor
);
240 if(!This
->travellog_cursor
)
243 prev
= LIST_ENTRY(list_prev(&This
->travellog
, &This
->travellog_cursor
->entry
),
244 travellog_entry
, entry
);
248 This
->travellog_cursor
= prev
;
252 static LPCITEMIDLIST
travellog_go_forward(ExplorerBrowserImpl
*This
)
254 travellog_entry
*next
;
255 TRACE("%p, %p\n", This
, This
->travellog_cursor
);
257 if(!This
->travellog_cursor
)
260 next
= LIST_ENTRY(list_next(&This
->travellog
, &This
->travellog_cursor
->entry
),
261 travellog_entry
, entry
);
265 This
->travellog_cursor
= next
;
269 /**************************************************************************
272 static void update_layout(ExplorerBrowserImpl
*This
)
275 INT navpane_width_actual
;
276 INT shellview_width_actual
;
277 TRACE("%p (navpane: %d, EBO_SHOWFRAMES: %d)\n",
278 This
, This
->navpane
.show
, This
->eb_options
& EBO_SHOWFRAMES
);
280 GetClientRect(This
->hwnd_main
, &rc
);
282 if((This
->eb_options
& EBO_SHOWFRAMES
) && This
->navpane
.show
)
283 navpane_width_actual
= This
->navpane
.width
;
285 navpane_width_actual
= 0;
287 shellview_width_actual
= rc
.right
- navpane_width_actual
;
288 if(shellview_width_actual
< SV_MIN_WIDTH
&& navpane_width_actual
)
290 INT missing_width
= SV_MIN_WIDTH
- shellview_width_actual
;
291 if(missing_width
< (navpane_width_actual
- NP_MIN_WIDTH
))
293 /* Shrink the navpane */
294 navpane_width_actual
-= missing_width
;
295 shellview_width_actual
+= missing_width
;
299 /* Hide the navpane */
300 shellview_width_actual
+= navpane_width_actual
;
301 navpane_width_actual
= 0;
305 /**************************************************************
306 * Calculate rectangles for the panes. All rectangles contain
307 * the position of the panes relative to hwnd_main.
310 if(navpane_width_actual
)
312 This
->navpane
.rc
.left
= This
->navpane
.rc
.top
= 0;
313 This
->navpane
.rc
.right
= navpane_width_actual
;
314 This
->navpane
.rc
.bottom
= rc
.bottom
;
316 if(!This
->navpane
.hwnd_splitter
)
317 initialize_navpane(This
, This
->hwnd_main
, &This
->navpane
.rc
);
320 ZeroMemory(&This
->navpane
.rc
, sizeof(RECT
));
322 This
->sv_rc
.left
= navpane_width_actual
;
324 This
->sv_rc
.right
= This
->sv_rc
.left
+ shellview_width_actual
;
325 This
->sv_rc
.bottom
= rc
.bottom
;
328 static void size_panes(ExplorerBrowserImpl
*This
)
330 MoveWindow(This
->navpane
.hwnd_splitter
,
331 This
->navpane
.rc
.right
- SPLITTER_WIDTH
, This
->navpane
.rc
.top
,
332 SPLITTER_WIDTH
, This
->navpane
.rc
.bottom
- This
->navpane
.rc
.top
,
335 MoveWindow(This
->hwnd_sv
,
336 This
->sv_rc
.left
, This
->sv_rc
.top
,
337 This
->sv_rc
.right
- This
->sv_rc
.left
, This
->sv_rc
.bottom
- This
->sv_rc
.top
,
341 static HRESULT
change_viewmode(ExplorerBrowserImpl
*This
, UINT viewmode
)
349 hr
= IShellView_QueryInterface(This
->psv
, &IID_IFolderView
, (void*)&pfv
);
352 hr
= IFolderView_SetCurrentViewMode(pfv
, This
->fs
.ViewMode
);
353 IFolderView_Release(pfv
);
359 static HRESULT
create_new_shellview(ExplorerBrowserImpl
*This
, IShellItem
*psi
)
361 IShellBrowser
*psb
= &This
->IShellBrowser_iface
;
367 TRACE("%p, %p\n", This
, psi
);
369 hr
= IShellItem_BindToHandler(psi
, NULL
, &BHID_SFObject
, &IID_IShellFolder
, (void**)&psf
);
372 hr
= IShellFolder_CreateViewObject(psf
, This
->hwnd_main
, &IID_IShellView
, (void**)&psv
);
377 IShellView_DestroyViewWindow(This
->psv
);
378 This
->hwnd_sv
= NULL
;
381 hr
= IShellView_CreateViewWindow(psv
, This
->psv
, &This
->fs
, psb
, &This
->sv_rc
, &hwnd_new
);
384 /* Replace the old shellview */
385 if(This
->psv
) IShellView_Release(This
->psv
);
388 This
->hwnd_sv
= hwnd_new
;
389 events_ViewCreated(This
, psv
);
393 ERR("CreateViewWindow failed (0x%x)\n", hr
);
394 IShellView_Release(psv
);
398 ERR("CreateViewObject failed (0x%x)\n", hr
);
400 IShellFolder_Release(psf
);
403 ERR("SI::BindToHandler failed (0x%x)\n", hr
);
408 static void get_interfaces_from_site(ExplorerBrowserImpl
*This
)
410 IServiceProvider
*psp
;
413 /* Calling this with This->punk_site set to NULL should properly
414 * release any previously fetched interfaces.
419 ICommDlgBrowser_Release(This
->pcdb_site
);
420 if(This
->pcdb2_site
) ICommDlgBrowser2_Release(This
->pcdb2_site
);
421 if(This
->pcdb3_site
) ICommDlgBrowser3_Release(This
->pcdb3_site
);
423 This
->pcdb_site
= NULL
;
424 This
->pcdb2_site
= NULL
;
425 This
->pcdb3_site
= NULL
;
430 IExplorerPaneVisibility_Release(This
->pepv_site
);
431 This
->pepv_site
= NULL
;
437 hr
= IUnknown_QueryInterface(This
->punk_site
, &IID_IServiceProvider
, (void**)&psp
);
440 ERR("Failed to get IServiceProvider from site.\n");
444 /* ICommDlgBrowser */
445 IServiceProvider_QueryService(psp
, &SID_SExplorerBrowserFrame
, &IID_ICommDlgBrowser
,
446 (void**)&This
->pcdb_site
);
447 IServiceProvider_QueryService(psp
, &SID_SExplorerBrowserFrame
, &IID_ICommDlgBrowser2
,
448 (void**)&This
->pcdb2_site
);
449 IServiceProvider_QueryService(psp
, &SID_SExplorerBrowserFrame
, &IID_ICommDlgBrowser3
,
450 (void**)&This
->pcdb3_site
);
452 /* IExplorerPaneVisibility */
453 IServiceProvider_QueryService(psp
, &SID_ExplorerPaneVisibility
, &IID_IExplorerPaneVisibility
,
454 (void**)&This
->pepv_site
);
456 IServiceProvider_Release(psp
);
459 /**************************************************************************
460 * General pane functionality.
462 static void update_panestate(ExplorerBrowserImpl
*This
)
464 EXPLORERPANESTATE eps
= EPS_DONTCARE
;
468 if(!This
->pepv_site
) return;
470 IExplorerPaneVisibility_GetPaneState(This
->pepv_site
, (REFEXPLORERPANE
) &EP_NavPane
, &eps
);
471 if( !(eps
& EPS_DEFAULT_OFF
) )
474 show_navpane
= FALSE
;
476 if(This
->navpane
.show
!= show_navpane
)
482 This
->navpane
.show
= show_navpane
;
485 static void splitter_draw(HWND hwnd
, RECT
*rc
)
487 HDC hdc
= GetDC(hwnd
);
489 ReleaseDC(hwnd
, hdc
);
492 /**************************************************************************
493 * The Navigation Pane.
495 static LRESULT
navpane_splitter_beginresize(ExplorerBrowserImpl
*This
, HWND hwnd
, LPARAM lParam
)
501 CopyRect(&This
->splitter_rc
, &This
->navpane
.rc
);
502 This
->splitter_rc
.left
= This
->splitter_rc
.right
- SPLITTER_WIDTH
;
504 splitter_draw(GetParent(hwnd
), &This
->splitter_rc
);
509 static LRESULT
navpane_splitter_resizing(ExplorerBrowserImpl
*This
, HWND hwnd
, LPARAM lParam
)
514 if(GetCapture() != hwnd
) return FALSE
;
516 dx
= (SHORT
)LOWORD(lParam
);
519 CopyRect(&rc
, &This
->navpane
.rc
);
521 new_width
= This
->navpane
.width
+ dx
;
522 if(new_width
> NP_MIN_WIDTH
&& This
->sv_rc
.right
- new_width
> SV_MIN_WIDTH
)
524 rc
.right
= new_width
;
525 rc
.left
= rc
.right
- SPLITTER_WIDTH
;
526 splitter_draw(GetParent(hwnd
), &This
->splitter_rc
);
527 splitter_draw(GetParent(hwnd
), &rc
);
528 CopyRect(&This
->splitter_rc
, &rc
);
534 static LRESULT
navpane_splitter_endresize(ExplorerBrowserImpl
*This
, HWND hwnd
, LPARAM lParam
)
538 if(GetCapture() != hwnd
) return FALSE
;
540 dx
= (SHORT
)LOWORD(lParam
);
543 splitter_draw(GetParent(hwnd
), &This
->splitter_rc
);
545 new_width
= This
->navpane
.width
+ dx
;
546 if(new_width
< NP_MIN_WIDTH
)
547 new_width
= NP_MIN_WIDTH
;
548 else if(This
->sv_rc
.right
- new_width
< SV_MIN_WIDTH
)
549 new_width
= This
->sv_rc
.right
- SV_MIN_WIDTH
;
551 This
->navpane
.width
= new_width
;
561 static LRESULT
navpane_on_wm_create(HWND hwnd
, CREATESTRUCTW
*crs
)
563 ExplorerBrowserImpl
*This
= crs
->lpCreateParams
;
564 INameSpaceTreeControl2
*pnstc2
;
569 SetWindowLongPtrW(hwnd
, GWLP_USERDATA
, (LPARAM
)This
);
570 This
->navpane
.hwnd_splitter
= hwnd
;
572 hr
= CoCreateInstance(&CLSID_NamespaceTreeControl
, NULL
, CLSCTX_INPROC_SERVER
,
573 &IID_INameSpaceTreeControl2
, (void**)&pnstc2
);
577 style
= NSTCS_HASEXPANDOS
| NSTCS_ROOTHASEXPANDO
| NSTCS_SHOWSELECTIONALWAYS
;
578 hr
= INameSpaceTreeControl2_Initialize(pnstc2
, GetParent(hwnd
), NULL
, style
);
581 INameSpaceTreeControlEvents
*pnstce
;
582 IShellFolder
*psfdesktop
;
586 DWORD cookie
, style2
= NSTCS2_DISPLAYPADDING
;
588 hr
= INameSpaceTreeControl2_SetControlStyle2(pnstc2
, 0xFF, style2
);
590 ERR("SetControlStyle2 failed (0x%08x)\n", hr
);
592 hr
= INameSpaceTreeControl2_QueryInterface(pnstc2
, &IID_IOleWindow
, (void**)&pow
);
595 IOleWindow_GetWindow(pow
, &This
->navpane
.hwnd_nstc
);
596 IOleWindow_Release(pow
);
599 ERR("QueryInterface(IOleWindow) failed (0x%08x)\n", hr
);
601 pnstce
= &This
->INameSpaceTreeControlEvents_iface
;
602 hr
= INameSpaceTreeControl2_TreeAdvise(pnstc2
, (IUnknown
*)pnstce
, &cookie
);
604 ERR("TreeAdvise failed. (0x%08x).\n", hr
);
607 * Add the default roots
610 /* TODO: This should be FOLDERID_Links */
611 hr
= SHGetSpecialFolderLocation(NULL
, CSIDL_FAVORITES
, &pidl
);
614 hr
= SHCreateShellItem(NULL
, NULL
, pidl
, &psi
);
617 hr
= INameSpaceTreeControl2_AppendRoot(pnstc2
, psi
, SHCONTF_NONFOLDERS
, NSTCRS_VISIBLE
, NULL
);
618 IShellItem_Release(psi
);
623 SHGetDesktopFolder(&psfdesktop
);
624 hr
= SHGetItemFromObject((IUnknown
*)psfdesktop
, &IID_IShellItem
, (void**)&psi
);
625 IShellFolder_Release(psfdesktop
);
628 hr
= INameSpaceTreeControl2_AppendRoot(pnstc2
, psi
, SHCONTF_FOLDERS
, NSTCRS_EXPANDED
, NULL
);
629 IShellItem_Release(psi
);
633 * We should advertise IID_INameSpaceTreeControl to the site of the
634 * host through its IProfferService interface, if any.
637 This
->navpane
.pnstc2
= pnstc2
;
638 This
->navpane
.nstc_cookie
= cookie
;
644 This
->navpane
.pnstc2
= NULL
;
645 ERR("Failed (0x%08x)\n", hr
);
650 static LRESULT
navpane_on_wm_size_move(ExplorerBrowserImpl
*This
)
655 width
= This
->navpane
.rc
.right
- This
->navpane
.rc
.left
- SPLITTER_WIDTH
;
656 height
= This
->navpane
.rc
.bottom
- This
->navpane
.rc
.top
;
658 MoveWindow(This
->navpane
.hwnd_nstc
,
659 This
->navpane
.rc
.left
, This
->navpane
.rc
.top
,
666 static LRESULT
navpane_on_wm_destroy(ExplorerBrowserImpl
*This
)
668 INameSpaceTreeControl2_TreeUnadvise(This
->navpane
.pnstc2
, This
->navpane
.nstc_cookie
);
669 INameSpaceTreeControl2_Release(This
->navpane
.pnstc2
);
670 This
->navpane
.pnstc2
= NULL
;
674 static LRESULT CALLBACK
navpane_wndproc(HWND hWnd
, UINT uMessage
, WPARAM wParam
, LPARAM lParam
)
676 ExplorerBrowserImpl
*This
= (ExplorerBrowserImpl
*)GetWindowLongPtrW(hWnd
, GWLP_USERDATA
);
679 case WM_CREATE
: return navpane_on_wm_create(hWnd
, (CREATESTRUCTW
*)lParam
);
680 case WM_MOVE
: /* Fall through */
681 case WM_SIZE
: return navpane_on_wm_size_move(This
);
682 case WM_DESTROY
: return navpane_on_wm_destroy(This
);
683 case WM_LBUTTONDOWN
: return navpane_splitter_beginresize(This
, hWnd
, lParam
);
684 case WM_MOUSEMOVE
: return navpane_splitter_resizing(This
, hWnd
, lParam
);
685 case WM_LBUTTONUP
: return navpane_splitter_endresize(This
, hWnd
, lParam
);
687 return DefWindowProcW(hWnd
, uMessage
, wParam
, lParam
);
692 static void initialize_navpane(ExplorerBrowserImpl
*This
, HWND hwnd_parent
, RECT
*rc
)
696 static const WCHAR navpane_classname
[] = {'e','b','_','n','a','v','p','a','n','e',0};
698 if( !GetClassInfoW(shell32_hInstance
, navpane_classname
, &wc
) )
700 wc
.style
= CS_HREDRAW
| CS_VREDRAW
;
701 wc
.lpfnWndProc
= navpane_wndproc
;
704 wc
.hInstance
= shell32_hInstance
;
706 wc
.hCursor
= LoadCursorW(0, (LPWSTR
)IDC_SIZEWE
);
707 wc
.hbrBackground
= (HBRUSH
)(COLOR_3DFACE
+ 1);
708 wc
.lpszMenuName
= NULL
;
709 wc
.lpszClassName
= navpane_classname
;
711 if (!RegisterClassW(&wc
)) return;
714 splitter
= CreateWindowExW(0, navpane_classname
, NULL
,
715 WS_CHILD
| WS_TABSTOP
| WS_VISIBLE
,
716 rc
->right
- SPLITTER_WIDTH
, rc
->top
,
717 SPLITTER_WIDTH
, rc
->bottom
- rc
->top
,
718 hwnd_parent
, 0, shell32_hInstance
, This
);
720 ERR("Failed to create navpane : %d.\n", GetLastError());
723 /**************************************************************************
724 * Main window related functions.
726 static LRESULT
main_on_wm_create(HWND hWnd
, CREATESTRUCTW
*crs
)
728 ExplorerBrowserImpl
*This
= crs
->lpCreateParams
;
731 SetWindowLongPtrW(hWnd
, GWLP_USERDATA
, (LPARAM
)This
);
732 This
->hwnd_main
= hWnd
;
737 static LRESULT
main_on_wm_size(ExplorerBrowserImpl
*This
)
745 static LRESULT
main_on_cwm_getishellbrowser(ExplorerBrowserImpl
*This
)
747 return (LRESULT
)&This
->IShellBrowser_iface
;
750 static LRESULT CALLBACK
main_wndproc(HWND hWnd
, UINT uMessage
, WPARAM wParam
, LPARAM lParam
)
752 ExplorerBrowserImpl
*This
= (ExplorerBrowserImpl
*)GetWindowLongPtrW(hWnd
, GWLP_USERDATA
);
756 case WM_CREATE
: return main_on_wm_create(hWnd
, (CREATESTRUCTW
*)lParam
);
757 case WM_SIZE
: return main_on_wm_size(This
);
758 case CWM_GETISHELLBROWSER
: return main_on_cwm_getishellbrowser(This
);
759 default: return DefWindowProcW(hWnd
, uMessage
, wParam
, lParam
);
765 /**************************************************************************
766 * IExplorerBrowser Implementation
769 static inline ExplorerBrowserImpl
*impl_from_IExplorerBrowser(IExplorerBrowser
*iface
)
771 return CONTAINING_RECORD(iface
, ExplorerBrowserImpl
, IExplorerBrowser_iface
);
774 static HRESULT WINAPI
IExplorerBrowser_fnQueryInterface(IExplorerBrowser
*iface
,
775 REFIID riid
, void **ppvObject
)
777 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
778 TRACE("%p (%s, %p)\n", This
, shdebugstr_guid(riid
), ppvObject
);
781 if(IsEqualIID(riid
, &IID_IExplorerBrowser
) ||
782 IsEqualIID(riid
, &IID_IUnknown
))
784 *ppvObject
= &This
->IExplorerBrowser_iface
;
786 else if(IsEqualIID(riid
, &IID_IShellBrowser
))
788 *ppvObject
= &This
->IShellBrowser_iface
;
790 else if(IsEqualIID(riid
, &IID_ICommDlgBrowser
) ||
791 IsEqualIID(riid
, &IID_ICommDlgBrowser2
) ||
792 IsEqualIID(riid
, &IID_ICommDlgBrowser3
))
794 *ppvObject
= &This
->ICommDlgBrowser3_iface
;
796 else if(IsEqualIID(riid
, &IID_IObjectWithSite
))
798 *ppvObject
= &This
->IObjectWithSite_iface
;
800 else if(IsEqualIID(riid
, &IID_IInputObject
))
802 *ppvObject
= &This
->IInputObject_iface
;
807 IUnknown_AddRef((IUnknown
*)*ppvObject
);
811 return E_NOINTERFACE
;
814 static ULONG WINAPI
IExplorerBrowser_fnAddRef(IExplorerBrowser
*iface
)
816 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
817 LONG ref
= InterlockedIncrement(&This
->ref
);
818 TRACE("%p - ref %d\n", This
, ref
);
823 static ULONG WINAPI
IExplorerBrowser_fnRelease(IExplorerBrowser
*iface
)
825 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
826 LONG ref
= InterlockedDecrement(&This
->ref
);
827 TRACE("%p - ref %d\n", This
, ref
);
834 IExplorerBrowser_Destroy(iface
);
836 IObjectWithSite_SetSite(&This
->IObjectWithSite_iface
, NULL
);
838 HeapFree(GetProcessHeap(), 0, This
);
845 static HRESULT WINAPI
IExplorerBrowser_fnInitialize(IExplorerBrowser
*iface
,
846 HWND hwndParent
, const RECT
*prc
,
847 const FOLDERSETTINGS
*pfs
)
849 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
852 static const WCHAR EB_CLASS_NAME
[] =
853 {'E','x','p','l','o','r','e','r','B','r','o','w','s','e','r','C','o','n','t','r','o','l',0};
855 TRACE("%p (%p, %p, %p)\n", This
, hwndParent
, prc
, pfs
);
863 if( !GetClassInfoW(shell32_hInstance
, EB_CLASS_NAME
, &wc
) )
865 wc
.style
= CS_HREDRAW
| CS_VREDRAW
;
866 wc
.lpfnWndProc
= main_wndproc
;
869 wc
.hInstance
= shell32_hInstance
;
871 wc
.hCursor
= LoadCursorW(0, (LPWSTR
)IDC_ARROW
);
872 wc
.hbrBackground
= (HBRUSH
)(COLOR_WINDOW
+ 1);
873 wc
.lpszMenuName
= NULL
;
874 wc
.lpszClassName
= EB_CLASS_NAME
;
876 if (!RegisterClassW(&wc
)) return E_FAIL
;
879 style
= WS_CHILD
| WS_VISIBLE
| WS_CLIPSIBLINGS
| WS_BORDER
;
880 This
->hwnd_main
= CreateWindowExW(WS_EX_CONTROLPARENT
, EB_CLASS_NAME
, NULL
, style
,
882 prc
->right
- prc
->left
, prc
->bottom
- prc
->top
,
883 hwndParent
, 0, shell32_hInstance
, This
);
887 ERR("Failed to create the window.\n");
891 This
->fs
.ViewMode
= pfs
? pfs
->ViewMode
: FVM_DETAILS
;
892 This
->fs
.fFlags
= pfs
? (pfs
->fFlags
| FWF_NOCLIENTEDGE
) : FWF_NOCLIENTEDGE
;
897 static HRESULT WINAPI
IExplorerBrowser_fnDestroy(IExplorerBrowser
*iface
)
899 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
904 IShellView_DestroyViewWindow(This
->psv
);
905 IShellView_Release(This
->psv
);
907 This
->hwnd_sv
= NULL
;
910 events_unadvise_all(This
);
911 travellog_remove_all_entries(This
);
913 ILFree(This
->current_pidl
);
914 This
->current_pidl
= NULL
;
916 DestroyWindow(This
->hwnd_main
);
917 This
->destroyed
= TRUE
;
922 static HRESULT WINAPI
IExplorerBrowser_fnSetRect(IExplorerBrowser
*iface
,
923 HDWP
*phdwp
, RECT rcBrowser
)
925 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
926 TRACE("%p (%p, %s)\n", This
, phdwp
, wine_dbgstr_rect(&rcBrowser
));
930 *phdwp
= DeferWindowPos(*phdwp
, This
->hwnd_main
, NULL
, rcBrowser
.left
, rcBrowser
.top
,
931 rcBrowser
.right
- rcBrowser
.left
, rcBrowser
.bottom
- rcBrowser
.top
,
932 SWP_NOZORDER
| SWP_NOACTIVATE
);
938 MoveWindow(This
->hwnd_main
, rcBrowser
.left
, rcBrowser
.top
,
939 rcBrowser
.right
- rcBrowser
.left
, rcBrowser
.bottom
- rcBrowser
.top
, TRUE
);
945 static HRESULT WINAPI
IExplorerBrowser_fnSetPropertyBag(IExplorerBrowser
*iface
,
946 LPCWSTR pszPropertyBag
)
948 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
949 FIXME("stub, %p (%s)\n", This
, debugstr_w(pszPropertyBag
));
954 /* FIXME: This method is currently useless as we don't save any
955 * settings anywhere, but at least one application breaks if we
962 static HRESULT WINAPI
IExplorerBrowser_fnSetEmptyText(IExplorerBrowser
*iface
,
963 LPCWSTR pszEmptyText
)
965 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
966 FIXME("stub, %p (%s)\n", This
, debugstr_w(pszEmptyText
));
971 static HRESULT WINAPI
IExplorerBrowser_fnSetFolderSettings(IExplorerBrowser
*iface
,
972 const FOLDERSETTINGS
*pfs
)
974 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
975 TRACE("%p (%p)\n", This
, pfs
);
980 This
->fs
.ViewMode
= pfs
->ViewMode
;
981 This
->fs
.fFlags
= pfs
->fFlags
| FWF_NOCLIENTEDGE
;
983 /* Change the settings of the current view, if any. */
984 return change_viewmode(This
, This
->fs
.ViewMode
);
987 static HRESULT WINAPI
IExplorerBrowser_fnAdvise(IExplorerBrowser
*iface
,
988 IExplorerBrowserEvents
*psbe
,
991 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
992 event_client
*client
;
993 TRACE("%p (%p, %p)\n", This
, psbe
, pdwCookie
);
995 client
= HeapAlloc(GetProcessHeap(), 0, sizeof(event_client
));
997 client
->cookie
= ++This
->events_next_cookie
;
999 IExplorerBrowserEvents_AddRef(psbe
);
1000 *pdwCookie
= client
->cookie
;
1002 list_add_tail(&This
->event_clients
, &client
->entry
);
1007 static HRESULT WINAPI
IExplorerBrowser_fnUnadvise(IExplorerBrowser
*iface
,
1010 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
1011 event_client
*client
;
1012 TRACE("%p (0x%x)\n", This
, dwCookie
);
1014 LIST_FOR_EACH_ENTRY(client
, &This
->event_clients
, event_client
, entry
)
1016 if(client
->cookie
== dwCookie
)
1018 list_remove(&client
->entry
);
1019 IExplorerBrowserEvents_Release(client
->pebe
);
1020 HeapFree(GetProcessHeap(), 0, client
);
1025 return E_INVALIDARG
;
1028 static HRESULT WINAPI
IExplorerBrowser_fnSetOptions(IExplorerBrowser
*iface
,
1029 EXPLORER_BROWSER_OPTIONS dwFlag
)
1031 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
1032 static const EXPLORER_BROWSER_OPTIONS unsupported_options
=
1033 EBO_ALWAYSNAVIGATE
| EBO_NOWRAPPERWINDOW
| EBO_HTMLSHAREPOINTVIEW
;
1035 TRACE("%p (0x%x)\n", This
, dwFlag
);
1037 if(dwFlag
& unsupported_options
)
1038 FIXME("Flags 0x%08x contains unsupported options.\n", dwFlag
);
1040 This
->eb_options
= dwFlag
;
1045 static HRESULT WINAPI
IExplorerBrowser_fnGetOptions(IExplorerBrowser
*iface
,
1046 EXPLORER_BROWSER_OPTIONS
*pdwFlag
)
1048 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
1049 TRACE("%p (%p)\n", This
, pdwFlag
);
1051 *pdwFlag
= This
->eb_options
;
1056 static HRESULT WINAPI
IExplorerBrowser_fnBrowseToIDList(IExplorerBrowser
*iface
,
1057 PCUIDLIST_RELATIVE pidl
,
1060 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
1061 LPITEMIDLIST absolute_pidl
= NULL
;
1063 static const UINT unsupported_browse_flags
=
1064 SBSP_NEWBROWSER
| EBF_SELECTFROMDATAOBJECT
| EBF_NODROPTARGET
;
1065 TRACE("%p (%p, 0x%x)\n", This
, pidl
, uFlags
);
1067 if(!This
->hwnd_main
)
1071 return HRESULT_FROM_WIN32(ERROR_BUSY
);
1073 if(This
->current_pidl
&& (This
->eb_options
& EBO_NAVIGATEONCE
))
1076 if(uFlags
& SBSP_EXPLOREMODE
)
1077 return E_INVALIDARG
;
1079 if(uFlags
& unsupported_browse_flags
)
1080 FIXME("Argument 0x%x contains unsupported flags.\n", uFlags
);
1082 if(uFlags
& SBSP_NAVIGATEBACK
)
1084 TRACE("SBSP_NAVIGATEBACK\n");
1085 absolute_pidl
= ILClone(travellog_go_back(This
));
1086 if(!absolute_pidl
&& !This
->current_pidl
)
1088 else if(!absolute_pidl
)
1092 else if(uFlags
& SBSP_NAVIGATEFORWARD
)
1094 TRACE("SBSP_NAVIGATEFORWARD\n");
1095 absolute_pidl
= ILClone(travellog_go_forward(This
));
1096 if(!absolute_pidl
&& !This
->current_pidl
)
1098 else if(!absolute_pidl
)
1102 else if(uFlags
& SBSP_PARENT
)
1104 if(This
->current_pidl
)
1106 if(_ILIsPidlSimple(This
->current_pidl
))
1108 absolute_pidl
= _ILCreateDesktop();
1112 absolute_pidl
= ILClone(This
->current_pidl
);
1113 ILRemoveLastID(absolute_pidl
);
1118 ERR("Failed to get parent pidl.\n");
1123 else if(uFlags
& SBSP_RELATIVE
)
1125 /* SBSP_RELATIVE has precedence over SBSP_ABSOLUTE */
1126 TRACE("SBSP_RELATIVE\n");
1127 if(This
->current_pidl
)
1129 absolute_pidl
= ILCombine(This
->current_pidl
, pidl
);
1133 ERR("Failed to get absolute pidl.\n");
1139 TRACE("SBSP_ABSOLUTE\n");
1140 absolute_pidl
= ILClone(pidl
);
1141 if(!absolute_pidl
&& !This
->current_pidl
)
1142 return E_INVALIDARG
;
1143 else if(!absolute_pidl
)
1147 /* TODO: Asynchronous browsing. Return S_OK here and finish in
1148 * another thread. */
1150 hr
= events_NavigationPending(This
, absolute_pidl
);
1153 TRACE("Browsing aborted.\n");
1154 ILFree(absolute_pidl
);
1158 get_interfaces_from_site(This
);
1159 update_panestate(This
);
1161 /* Only browse if the new pidl differs from the old */
1162 if(!ILIsEqual(This
->current_pidl
, absolute_pidl
))
1165 hr
= SHCreateItemFromIDList(absolute_pidl
, &IID_IShellItem
, (void**)&psi
);
1168 hr
= create_new_shellview(This
, psi
);
1171 events_NavigationFailed(This
, absolute_pidl
);
1172 ILFree(absolute_pidl
);
1173 IShellItem_Release(psi
);
1177 /* Add to travellog */
1178 if( !(This
->eb_options
& EBO_NOTRAVELLOG
) &&
1179 !(uFlags
& (SBSP_NAVIGATEFORWARD
|SBSP_NAVIGATEBACK
)) )
1181 travellog_add_entry(This
, absolute_pidl
);
1184 IShellItem_Release(psi
);
1188 events_NavigationComplete(This
, absolute_pidl
);
1189 ILFree(This
->current_pidl
);
1190 This
->current_pidl
= absolute_pidl
;
1192 /* Expand the NameSpaceTree to the current location. */
1193 if(This
->navpane
.show
&& This
->navpane
.pnstc2
)
1196 hr
= SHCreateItemFromIDList(This
->current_pidl
, &IID_IShellItem
, (void**)&psi
);
1199 INameSpaceTreeControl2_EnsureItemVisible(This
->navpane
.pnstc2
, psi
);
1200 IShellItem_Release(psi
);
1207 static HRESULT WINAPI
IExplorerBrowser_fnBrowseToObject(IExplorerBrowser
*iface
,
1208 IUnknown
*punk
, UINT uFlags
)
1210 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
1213 TRACE("%p (%p, 0x%x)\n", This
, punk
, uFlags
);
1216 return IExplorerBrowser_BrowseToIDList(iface
, NULL
, uFlags
);
1218 hr
= SHGetIDListFromObject(punk
, &pidl
);
1221 hr
= IExplorerBrowser_BrowseToIDList(iface
, pidl
, uFlags
);
1228 static HRESULT WINAPI
IExplorerBrowser_fnFillFromObject(IExplorerBrowser
*iface
,
1230 EXPLORER_BROWSER_FILL_FLAGS dwFlags
)
1232 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
1233 FIXME("stub, %p (%p, 0x%x)\n", This
, punk
, dwFlags
);
1238 static HRESULT WINAPI
IExplorerBrowser_fnRemoveAll(IExplorerBrowser
*iface
)
1240 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
1241 FIXME("stub, %p\n", This
);
1246 static HRESULT WINAPI
IExplorerBrowser_fnGetCurrentView(IExplorerBrowser
*iface
,
1247 REFIID riid
, void **ppv
)
1249 ExplorerBrowserImpl
*This
= impl_from_IExplorerBrowser(iface
);
1250 TRACE("%p (%s, %p)\n", This
, shdebugstr_guid(riid
), ppv
);
1255 return IShellView_QueryInterface(This
->psv
, riid
, ppv
);
1258 static const IExplorerBrowserVtbl vt_IExplorerBrowser
=
1260 IExplorerBrowser_fnQueryInterface
,
1261 IExplorerBrowser_fnAddRef
,
1262 IExplorerBrowser_fnRelease
,
1263 IExplorerBrowser_fnInitialize
,
1264 IExplorerBrowser_fnDestroy
,
1265 IExplorerBrowser_fnSetRect
,
1266 IExplorerBrowser_fnSetPropertyBag
,
1267 IExplorerBrowser_fnSetEmptyText
,
1268 IExplorerBrowser_fnSetFolderSettings
,
1269 IExplorerBrowser_fnAdvise
,
1270 IExplorerBrowser_fnUnadvise
,
1271 IExplorerBrowser_fnSetOptions
,
1272 IExplorerBrowser_fnGetOptions
,
1273 IExplorerBrowser_fnBrowseToIDList
,
1274 IExplorerBrowser_fnBrowseToObject
,
1275 IExplorerBrowser_fnFillFromObject
,
1276 IExplorerBrowser_fnRemoveAll
,
1277 IExplorerBrowser_fnGetCurrentView
1280 /**************************************************************************
1281 * IShellBrowser Implementation
1284 static inline ExplorerBrowserImpl
*impl_from_IShellBrowser(IShellBrowser
*iface
)
1286 return CONTAINING_RECORD(iface
, ExplorerBrowserImpl
, IShellBrowser_iface
);
1289 static HRESULT WINAPI
IShellBrowser_fnQueryInterface(IShellBrowser
*iface
,
1290 REFIID riid
, void **ppvObject
)
1292 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1293 TRACE("%p\n", This
);
1294 return IExplorerBrowser_QueryInterface(&This
->IExplorerBrowser_iface
, riid
, ppvObject
);
1297 static ULONG WINAPI
IShellBrowser_fnAddRef(IShellBrowser
*iface
)
1299 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1300 TRACE("%p\n", This
);
1301 return IExplorerBrowser_AddRef(&This
->IExplorerBrowser_iface
);
1304 static ULONG WINAPI
IShellBrowser_fnRelease(IShellBrowser
*iface
)
1306 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1307 TRACE("%p\n", This
);
1308 return IExplorerBrowser_Release(&This
->IExplorerBrowser_iface
);
1311 static HRESULT WINAPI
IShellBrowser_fnGetWindow(IShellBrowser
*iface
, HWND
*phwnd
)
1313 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1314 TRACE("%p (%p)\n", This
, phwnd
);
1316 if(!This
->hwnd_main
)
1319 *phwnd
= This
->hwnd_main
;
1323 static HRESULT WINAPI
IShellBrowser_fnContextSensitiveHelp(IShellBrowser
*iface
,
1326 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1327 FIXME("stub, %p (%d)\n", This
, fEnterMode
);
1332 static HRESULT WINAPI
IShellBrowser_fnInsertMenusSB(IShellBrowser
*iface
,
1334 LPOLEMENUGROUPWIDTHS lpMenuWidths
)
1336 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1337 TRACE("%p (%p, %p)\n", This
, hmenuShared
, lpMenuWidths
);
1339 /* Not implemented. */
1343 static HRESULT WINAPI
IShellBrowser_fnSetMenuSB(IShellBrowser
*iface
,
1345 HOLEMENU holemenuReserved
,
1346 HWND hwndActiveObject
)
1348 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1349 TRACE("%p (%p, %p, %p)\n", This
, hmenuShared
, holemenuReserved
, hwndActiveObject
);
1351 /* Not implemented. */
1355 static HRESULT WINAPI
IShellBrowser_fnRemoveMenusSB(IShellBrowser
*iface
,
1358 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1359 TRACE("%p (%p)\n", This
, hmenuShared
);
1361 /* Not implemented. */
1365 static HRESULT WINAPI
IShellBrowser_fnSetStatusTextSB(IShellBrowser
*iface
,
1366 LPCOLESTR pszStatusText
)
1368 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1369 FIXME("stub, %p (%s)\n", This
, debugstr_w(pszStatusText
));
1374 static HRESULT WINAPI
IShellBrowser_fnEnableModelessSB(IShellBrowser
*iface
,
1377 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1378 FIXME("stub, %p (%d)\n", This
, fEnable
);
1383 static HRESULT WINAPI
IShellBrowser_fnTranslateAcceleratorSB(IShellBrowser
*iface
,
1384 MSG
*pmsg
, WORD wID
)
1386 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1387 FIXME("stub, %p (%p, 0x%x)\n", This
, pmsg
, wID
);
1392 static HRESULT WINAPI
IShellBrowser_fnBrowseObject(IShellBrowser
*iface
,
1393 LPCITEMIDLIST pidl
, UINT wFlags
)
1395 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1396 TRACE("%p (%p, %x)\n", This
, pidl
, wFlags
);
1398 return IExplorerBrowser_BrowseToIDList(&This
->IExplorerBrowser_iface
, pidl
, wFlags
);
1401 static HRESULT WINAPI
IShellBrowser_fnGetViewStateStream(IShellBrowser
*iface
,
1405 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1406 FIXME("stub, %p (0x%x, %p)\n", This
, grfMode
, ppStrm
);
1412 static HRESULT WINAPI
IShellBrowser_fnGetControlWindow(IShellBrowser
*iface
,
1413 UINT id
, HWND
*phwnd
)
1415 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1416 TRACE("(%p)->(%d, %p)\n", This
, id
, phwnd
);
1417 if (phwnd
) *phwnd
= NULL
;
1421 static HRESULT WINAPI
IShellBrowser_fnSendControlMsg(IShellBrowser
*iface
,
1423 WPARAM wParam
, LPARAM lParam
,
1426 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1427 FIXME("stub, %p (%d, %d, %lx, %lx, %p)\n", This
, id
, uMsg
, wParam
, lParam
, pret
);
1432 static HRESULT WINAPI
IShellBrowser_fnQueryActiveShellView(IShellBrowser
*iface
,
1435 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1436 TRACE("%p (%p)\n", This
, ppshv
);
1442 IShellView_AddRef(This
->psv
);
1447 static HRESULT WINAPI
IShellBrowser_fnOnViewWindowActive(IShellBrowser
*iface
,
1450 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1451 FIXME("stub, %p (%p)\n", This
, pshv
);
1456 static HRESULT WINAPI
IShellBrowser_fnSetToolbarItems(IShellBrowser
*iface
,
1457 LPTBBUTTONSB lpButtons
,
1458 UINT nButtons
, UINT uFlags
)
1460 ExplorerBrowserImpl
*This
= impl_from_IShellBrowser(iface
);
1461 FIXME("stub, %p (%p, %d, 0x%x)\n", This
, lpButtons
, nButtons
, uFlags
);
1466 static const IShellBrowserVtbl vt_IShellBrowser
= {
1467 IShellBrowser_fnQueryInterface
,
1468 IShellBrowser_fnAddRef
,
1469 IShellBrowser_fnRelease
,
1470 IShellBrowser_fnGetWindow
,
1471 IShellBrowser_fnContextSensitiveHelp
,
1472 IShellBrowser_fnInsertMenusSB
,
1473 IShellBrowser_fnSetMenuSB
,
1474 IShellBrowser_fnRemoveMenusSB
,
1475 IShellBrowser_fnSetStatusTextSB
,
1476 IShellBrowser_fnEnableModelessSB
,
1477 IShellBrowser_fnTranslateAcceleratorSB
,
1478 IShellBrowser_fnBrowseObject
,
1479 IShellBrowser_fnGetViewStateStream
,
1480 IShellBrowser_fnGetControlWindow
,
1481 IShellBrowser_fnSendControlMsg
,
1482 IShellBrowser_fnQueryActiveShellView
,
1483 IShellBrowser_fnOnViewWindowActive
,
1484 IShellBrowser_fnSetToolbarItems
1487 /**************************************************************************
1488 * ICommDlgBrowser3 Implementation
1491 static inline ExplorerBrowserImpl
*impl_from_ICommDlgBrowser3(ICommDlgBrowser3
*iface
)
1493 return CONTAINING_RECORD(iface
, ExplorerBrowserImpl
, ICommDlgBrowser3_iface
);
1496 static HRESULT WINAPI
ICommDlgBrowser3_fnQueryInterface(ICommDlgBrowser3
*iface
,
1500 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1501 TRACE("%p\n", This
);
1502 return IExplorerBrowser_QueryInterface(&This
->IExplorerBrowser_iface
, riid
, ppvObject
);
1505 static ULONG WINAPI
ICommDlgBrowser3_fnAddRef(ICommDlgBrowser3
*iface
)
1507 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1508 TRACE("%p\n", This
);
1509 return IExplorerBrowser_AddRef(&This
->IExplorerBrowser_iface
);
1512 static ULONG WINAPI
ICommDlgBrowser3_fnRelease(ICommDlgBrowser3
*iface
)
1514 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1515 TRACE("%p\n", This
);
1516 return IExplorerBrowser_Release(&This
->IExplorerBrowser_iface
);
1519 static HRESULT WINAPI
ICommDlgBrowser3_fnOnDefaultCommand(ICommDlgBrowser3
*iface
,
1522 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1525 HRESULT ret
= S_FALSE
;
1527 TRACE("%p (%p)\n", This
, shv
);
1529 hr
= IShellView_GetItemObject(shv
, SVGIO_SELECTION
, &IID_IDataObject
, (void**)&pdo
);
1535 fmt
.cfFormat
= RegisterClipboardFormatW(CFSTR_SHELLIDLISTW
);
1537 fmt
.dwAspect
= DVASPECT_CONTENT
;
1539 fmt
.tymed
= TYMED_HGLOBAL
;
1541 hr
= IDataObject_GetData(pdo
, &fmt
,&medium
);
1542 IDataObject_Release(pdo
);
1545 LPIDA pida
= GlobalLock(medium
.u
.hGlobal
);
1546 LPCITEMIDLIST pidl_child
= (LPCITEMIDLIST
) ((LPBYTE
)pida
+pida
->aoffset
[1]);
1548 /* Handle folders by browsing to them. */
1549 if(_ILIsFolder(pidl_child
) || _ILIsDrive(pidl_child
) || _ILIsSpecialFolder(pidl_child
))
1551 IExplorerBrowser_BrowseToIDList(&This
->IExplorerBrowser_iface
, pidl_child
, SBSP_RELATIVE
);
1554 GlobalUnlock(medium
.u
.hGlobal
);
1555 GlobalFree(medium
.u
.hGlobal
);
1558 ERR("Failed to get data from IDataObject.\n");
1560 ERR("Failed to get IDataObject.\n");
1562 /* If we didn't handle the default command, check if we have a
1563 * client that does */
1564 if(ret
== S_FALSE
&& This
->pcdb_site
)
1565 return ICommDlgBrowser_OnDefaultCommand(This
->pcdb_site
, shv
);
1569 static HRESULT WINAPI
ICommDlgBrowser3_fnOnStateChange(ICommDlgBrowser3
*iface
,
1570 IShellView
*shv
, ULONG uChange
)
1572 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1573 TRACE("%p (%p, %d)\n", This
, shv
, uChange
);
1576 return ICommDlgBrowser_OnStateChange(This
->pcdb_site
, shv
, uChange
);
1580 static HRESULT WINAPI
ICommDlgBrowser3_fnIncludeObject(ICommDlgBrowser3
*iface
,
1581 IShellView
*pshv
, LPCITEMIDLIST pidl
)
1583 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1584 TRACE("%p (%p, %p)\n", This
, pshv
, pidl
);
1587 return ICommDlgBrowser_IncludeObject(This
->pcdb_site
, pshv
, pidl
);
1592 static HRESULT WINAPI
ICommDlgBrowser3_fnNotify(ICommDlgBrowser3
*iface
,
1596 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1597 TRACE("%p (%p, 0x%x)\n", This
, pshv
, dwNotifyType
);
1599 if(This
->pcdb2_site
)
1600 return ICommDlgBrowser2_Notify(This
->pcdb2_site
, pshv
, dwNotifyType
);
1605 static HRESULT WINAPI
ICommDlgBrowser3_fnGetDefaultMenuText(ICommDlgBrowser3
*iface
,
1607 LPWSTR pszText
, int cchMax
)
1609 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1610 TRACE("%p (%p, %s, %d)\n", This
, pshv
, debugstr_w(pszText
), cchMax
);
1612 if(This
->pcdb2_site
)
1613 return ICommDlgBrowser2_GetDefaultMenuText(This
->pcdb2_site
, pshv
, pszText
, cchMax
);
1618 static HRESULT WINAPI
ICommDlgBrowser3_fnGetViewFlags(ICommDlgBrowser3
*iface
,
1621 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1622 TRACE("%p (%p)\n", This
, pdwFlags
);
1624 if(This
->pcdb2_site
)
1625 return ICommDlgBrowser2_GetViewFlags(This
->pcdb2_site
, pdwFlags
);
1630 static HRESULT WINAPI
ICommDlgBrowser3_fnOnColumnClicked(ICommDlgBrowser3
*iface
,
1631 IShellView
*pshv
, int iColumn
)
1633 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1634 TRACE("%p (%p, %d)\n", This
, pshv
, iColumn
);
1636 if(This
->pcdb3_site
)
1637 return ICommDlgBrowser3_OnColumnClicked(This
->pcdb3_site
, pshv
, iColumn
);
1642 static HRESULT WINAPI
ICommDlgBrowser3_fnGetCurrentFilter(ICommDlgBrowser3
*iface
,
1646 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1647 TRACE("%p (%s, %d)\n", This
, debugstr_w(pszFileSpec
), cchFileSpec
);
1649 if(This
->pcdb3_site
)
1650 return ICommDlgBrowser3_GetCurrentFilter(This
->pcdb3_site
, pszFileSpec
, cchFileSpec
);
1655 static HRESULT WINAPI
ICommDlgBrowser3_fnOnPreviewCreated(ICommDlgBrowser3
*iface
,
1658 ExplorerBrowserImpl
*This
= impl_from_ICommDlgBrowser3(iface
);
1659 TRACE("%p (%p)\n", This
, pshv
);
1661 if(This
->pcdb3_site
)
1662 return ICommDlgBrowser3_OnPreviewCreated(This
->pcdb3_site
, pshv
);
1667 static const ICommDlgBrowser3Vtbl vt_ICommDlgBrowser3
= {
1668 ICommDlgBrowser3_fnQueryInterface
,
1669 ICommDlgBrowser3_fnAddRef
,
1670 ICommDlgBrowser3_fnRelease
,
1671 ICommDlgBrowser3_fnOnDefaultCommand
,
1672 ICommDlgBrowser3_fnOnStateChange
,
1673 ICommDlgBrowser3_fnIncludeObject
,
1674 ICommDlgBrowser3_fnNotify
,
1675 ICommDlgBrowser3_fnGetDefaultMenuText
,
1676 ICommDlgBrowser3_fnGetViewFlags
,
1677 ICommDlgBrowser3_fnOnColumnClicked
,
1678 ICommDlgBrowser3_fnGetCurrentFilter
,
1679 ICommDlgBrowser3_fnOnPreviewCreated
1682 /**************************************************************************
1683 * IObjectWithSite Implementation
1686 static inline ExplorerBrowserImpl
*impl_from_IObjectWithSite(IObjectWithSite
*iface
)
1688 return CONTAINING_RECORD(iface
, ExplorerBrowserImpl
, IObjectWithSite_iface
);
1691 static HRESULT WINAPI
IObjectWithSite_fnQueryInterface(IObjectWithSite
*iface
,
1692 REFIID riid
, void **ppvObject
)
1694 ExplorerBrowserImpl
*This
= impl_from_IObjectWithSite(iface
);
1695 TRACE("%p\n", This
);
1696 return IExplorerBrowser_QueryInterface(&This
->IExplorerBrowser_iface
, riid
, ppvObject
);
1699 static ULONG WINAPI
IObjectWithSite_fnAddRef(IObjectWithSite
*iface
)
1701 ExplorerBrowserImpl
*This
= impl_from_IObjectWithSite(iface
);
1702 TRACE("%p\n", This
);
1703 return IExplorerBrowser_AddRef(&This
->IExplorerBrowser_iface
);
1706 static ULONG WINAPI
IObjectWithSite_fnRelease(IObjectWithSite
*iface
)
1708 ExplorerBrowserImpl
*This
= impl_from_IObjectWithSite(iface
);
1709 TRACE("%p\n", This
);
1710 return IExplorerBrowser_Release(&This
->IExplorerBrowser_iface
);
1713 static HRESULT WINAPI
IObjectWithSite_fnSetSite(IObjectWithSite
*iface
, IUnknown
*punk_site
)
1715 ExplorerBrowserImpl
*This
= impl_from_IObjectWithSite(iface
);
1716 TRACE("%p (%p)\n", This
, punk_site
);
1720 IUnknown_Release(This
->punk_site
);
1721 This
->punk_site
= NULL
;
1722 get_interfaces_from_site(This
);
1725 This
->punk_site
= punk_site
;
1728 IUnknown_AddRef(This
->punk_site
);
1733 static HRESULT WINAPI
IObjectWithSite_fnGetSite(IObjectWithSite
*iface
, REFIID riid
, void **ppvSite
)
1735 ExplorerBrowserImpl
*This
= impl_from_IObjectWithSite(iface
);
1736 TRACE("%p (%s, %p)\n", This
, shdebugstr_guid(riid
), ppvSite
);
1738 if(!This
->punk_site
)
1741 return IUnknown_QueryInterface(This
->punk_site
, riid
, ppvSite
);
1744 static const IObjectWithSiteVtbl vt_IObjectWithSite
= {
1745 IObjectWithSite_fnQueryInterface
,
1746 IObjectWithSite_fnAddRef
,
1747 IObjectWithSite_fnRelease
,
1748 IObjectWithSite_fnSetSite
,
1749 IObjectWithSite_fnGetSite
1752 /**************************************************************************
1753 * INameSpaceTreeControlEvents Implementation
1755 static inline ExplorerBrowserImpl
*impl_from_INameSpaceTreeControlEvents(INameSpaceTreeControlEvents
*iface
)
1757 return CONTAINING_RECORD(iface
, ExplorerBrowserImpl
, INameSpaceTreeControlEvents_iface
);
1760 static HRESULT WINAPI
NSTCEvents_fnQueryInterface(INameSpaceTreeControlEvents
*iface
,
1761 REFIID riid
, void **ppvObject
)
1763 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1764 TRACE("%p (%s, %p)\n", This
, shdebugstr_guid(riid
), ppvObject
);
1767 if(IsEqualIID(riid
, &IID_INameSpaceTreeControlEvents
) ||
1768 IsEqualIID(riid
, &IID_IUnknown
))
1775 IUnknown_AddRef((IUnknown
*)*ppvObject
);
1779 return E_NOINTERFACE
;
1782 static ULONG WINAPI
NSTCEvents_fnAddRef(INameSpaceTreeControlEvents
*iface
)
1784 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1785 TRACE("%p\n", This
);
1786 return IExplorerBrowser_AddRef(&This
->IExplorerBrowser_iface
);
1789 static ULONG WINAPI
NSTCEvents_fnRelease(INameSpaceTreeControlEvents
*iface
)
1791 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1792 TRACE("%p\n", This
);
1793 return IExplorerBrowser_Release(&This
->IExplorerBrowser_iface
);
1796 static HRESULT WINAPI
NSTCEvents_fnOnItemClick(INameSpaceTreeControlEvents
*iface
,
1798 NSTCEHITTEST nstceHitTest
,
1799 NSTCECLICKTYPE nstceClickType
)
1801 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1802 TRACE("%p (%p, 0x%x, 0x%x)\n", This
, psi
, nstceHitTest
, nstceClickType
);
1806 static HRESULT WINAPI
NSTCEvents_fnOnPropertyItemCommit(INameSpaceTreeControlEvents
*iface
,
1809 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1810 TRACE("%p (%p)\n", This
, psi
);
1814 static HRESULT WINAPI
NSTCEvents_fnOnItemStateChanging(INameSpaceTreeControlEvents
*iface
,
1816 NSTCITEMSTATE nstcisMask
,
1817 NSTCITEMSTATE nstcisState
)
1819 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1820 TRACE("%p (%p, 0x%x, 0x%x)\n", This
, psi
, nstcisMask
, nstcisState
);
1824 static HRESULT WINAPI
NSTCEvents_fnOnItemStateChanged(INameSpaceTreeControlEvents
*iface
,
1826 NSTCITEMSTATE nstcisMask
,
1827 NSTCITEMSTATE nstcisState
)
1829 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1830 TRACE("%p (%p, 0x%x, 0x%x)\n", This
, psi
, nstcisMask
, nstcisState
);
1834 static HRESULT WINAPI
NSTCEvents_fnOnSelectionChanged(INameSpaceTreeControlEvents
*iface
,
1835 IShellItemArray
*psiaSelection
)
1837 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1840 TRACE("%p (%p)\n", This
, psiaSelection
);
1842 hr
= IShellItemArray_GetItemAt(psiaSelection
, 0, &psi
);
1845 hr
= IExplorerBrowser_BrowseToObject(&This
->IExplorerBrowser_iface
,
1846 (IUnknown
*)psi
, SBSP_DEFBROWSER
);
1847 IShellItem_Release(psi
);
1853 static HRESULT WINAPI
NSTCEvents_fnOnKeyboardInput(INameSpaceTreeControlEvents
*iface
,
1854 UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
1856 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1857 TRACE("%p (%d, 0x%lx, 0x%lx)\n", This
, uMsg
, wParam
, lParam
);
1861 static HRESULT WINAPI
NSTCEvents_fnOnBeforeExpand(INameSpaceTreeControlEvents
*iface
,
1864 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1865 TRACE("%p (%p)\n", This
, psi
);
1869 static HRESULT WINAPI
NSTCEvents_fnOnAfterExpand(INameSpaceTreeControlEvents
*iface
,
1872 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1873 TRACE("%p (%p)\n", This
, psi
);
1877 static HRESULT WINAPI
NSTCEvents_fnOnBeginLabelEdit(INameSpaceTreeControlEvents
*iface
,
1880 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1881 TRACE("%p (%p)\n", This
, psi
);
1885 static HRESULT WINAPI
NSTCEvents_fnOnEndLabelEdit(INameSpaceTreeControlEvents
*iface
,
1888 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1889 TRACE("%p (%p)\n", This
, psi
);
1893 static HRESULT WINAPI
NSTCEvents_fnOnGetToolTip(INameSpaceTreeControlEvents
*iface
,
1894 IShellItem
*psi
, LPWSTR pszTip
, int cchTip
)
1896 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1897 TRACE("%p (%p, %p, %d)\n", This
, psi
, pszTip
, cchTip
);
1901 static HRESULT WINAPI
NSTCEvents_fnOnBeforeItemDelete(INameSpaceTreeControlEvents
*iface
,
1904 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1905 TRACE("%p (%p)\n", This
, psi
);
1909 static HRESULT WINAPI
NSTCEvents_fnOnItemAdded(INameSpaceTreeControlEvents
*iface
,
1910 IShellItem
*psi
, BOOL fIsRoot
)
1912 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1913 TRACE("%p (%p, %d)\n", This
, psi
, fIsRoot
);
1917 static HRESULT WINAPI
NSTCEvents_fnOnItemDeleted(INameSpaceTreeControlEvents
*iface
,
1918 IShellItem
*psi
, BOOL fIsRoot
)
1920 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1921 TRACE("%p (%p, %d)\n", This
, psi
, fIsRoot
);
1925 static HRESULT WINAPI
NSTCEvents_fnOnBeforeContextMenu(INameSpaceTreeControlEvents
*iface
,
1926 IShellItem
*psi
, REFIID riid
, void **ppv
)
1928 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1929 TRACE("%p (%p, %s, %p)\n", This
, psi
, shdebugstr_guid(riid
), ppv
);
1933 static HRESULT WINAPI
NSTCEvents_fnOnAfterContextMenu(INameSpaceTreeControlEvents
*iface
,
1934 IShellItem
*psi
, IContextMenu
*pcmIn
,
1935 REFIID riid
, void **ppv
)
1937 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1938 TRACE("%p (%p, %p, %s, %p)\n", This
, psi
, pcmIn
, shdebugstr_guid(riid
), ppv
);
1942 static HRESULT WINAPI
NSTCEvents_fnOnBeforeStateImageChange(INameSpaceTreeControlEvents
*iface
,
1945 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1946 TRACE("%p (%p)\n", This
, psi
);
1950 static HRESULT WINAPI
NSTCEvents_fnOnGetDefaultIconIndex(INameSpaceTreeControlEvents
* iface
,
1952 int *piDefaultIcon
, int *piOpenIcon
)
1954 ExplorerBrowserImpl
*This
= impl_from_INameSpaceTreeControlEvents(iface
);
1955 TRACE("%p (%p, %p, %p)\n", This
, psi
, piDefaultIcon
, piOpenIcon
);
1960 static const INameSpaceTreeControlEventsVtbl vt_INameSpaceTreeControlEvents
= {
1961 NSTCEvents_fnQueryInterface
,
1962 NSTCEvents_fnAddRef
,
1963 NSTCEvents_fnRelease
,
1964 NSTCEvents_fnOnItemClick
,
1965 NSTCEvents_fnOnPropertyItemCommit
,
1966 NSTCEvents_fnOnItemStateChanging
,
1967 NSTCEvents_fnOnItemStateChanged
,
1968 NSTCEvents_fnOnSelectionChanged
,
1969 NSTCEvents_fnOnKeyboardInput
,
1970 NSTCEvents_fnOnBeforeExpand
,
1971 NSTCEvents_fnOnAfterExpand
,
1972 NSTCEvents_fnOnBeginLabelEdit
,
1973 NSTCEvents_fnOnEndLabelEdit
,
1974 NSTCEvents_fnOnGetToolTip
,
1975 NSTCEvents_fnOnBeforeItemDelete
,
1976 NSTCEvents_fnOnItemAdded
,
1977 NSTCEvents_fnOnItemDeleted
,
1978 NSTCEvents_fnOnBeforeContextMenu
,
1979 NSTCEvents_fnOnAfterContextMenu
,
1980 NSTCEvents_fnOnBeforeStateImageChange
,
1981 NSTCEvents_fnOnGetDefaultIconIndex
1984 /**************************************************************************
1985 * IInputObject Implementation
1988 static inline ExplorerBrowserImpl
*impl_from_IInputObject(IInputObject
*iface
)
1990 return CONTAINING_RECORD(iface
, ExplorerBrowserImpl
, IInputObject_iface
);
1993 static HRESULT WINAPI
IInputObject_fnQueryInterface(IInputObject
*iface
,
1994 REFIID riid
, void **ppvObject
)
1996 ExplorerBrowserImpl
*This
= impl_from_IInputObject(iface
);
1997 TRACE("%p\n", This
);
1998 return IExplorerBrowser_QueryInterface(&This
->IExplorerBrowser_iface
, riid
, ppvObject
);
2001 static ULONG WINAPI
IInputObject_fnAddRef(IInputObject
*iface
)
2003 ExplorerBrowserImpl
*This
= impl_from_IInputObject(iface
);
2004 TRACE("%p\n", This
);
2005 return IExplorerBrowser_AddRef(&This
->IExplorerBrowser_iface
);
2008 static ULONG WINAPI
IInputObject_fnRelease(IInputObject
*iface
)
2010 ExplorerBrowserImpl
*This
= impl_from_IInputObject(iface
);
2011 TRACE("%p\n", This
);
2012 return IExplorerBrowser_Release(&This
->IExplorerBrowser_iface
);
2015 static HRESULT WINAPI
IInputObject_fnUIActivateIO(IInputObject
*iface
, BOOL fActivate
, MSG
*pMsg
)
2017 ExplorerBrowserImpl
*This
= impl_from_IInputObject(iface
);
2018 FIXME("stub, %p (%d, %p)\n", This
, fActivate
, pMsg
);
2022 static HRESULT WINAPI
IInputObject_fnHasFocusIO(IInputObject
*iface
)
2024 ExplorerBrowserImpl
*This
= impl_from_IInputObject(iface
);
2025 FIXME("stub, %p\n", This
);
2029 static HRESULT WINAPI
IInputObject_fnTranslateAcceleratorIO(IInputObject
*iface
, MSG
*pMsg
)
2031 ExplorerBrowserImpl
*This
= impl_from_IInputObject(iface
);
2032 FIXME("stub, %p (%p)\n", This
, pMsg
);
2036 static IInputObjectVtbl vt_IInputObject
= {
2037 IInputObject_fnQueryInterface
,
2038 IInputObject_fnAddRef
,
2039 IInputObject_fnRelease
,
2040 IInputObject_fnUIActivateIO
,
2041 IInputObject_fnHasFocusIO
,
2042 IInputObject_fnTranslateAcceleratorIO
2045 HRESULT WINAPI
ExplorerBrowser_Constructor(IUnknown
*pUnkOuter
, REFIID riid
, void **ppv
)
2047 ExplorerBrowserImpl
*eb
;
2050 TRACE("%p %s %p\n", pUnkOuter
, shdebugstr_guid (riid
), ppv
);
2055 return CLASS_E_NOAGGREGATION
;
2057 eb
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(ExplorerBrowserImpl
));
2059 eb
->IExplorerBrowser_iface
.lpVtbl
= &vt_IExplorerBrowser
;
2060 eb
->IShellBrowser_iface
.lpVtbl
= &vt_IShellBrowser
;
2061 eb
->ICommDlgBrowser3_iface
.lpVtbl
= &vt_ICommDlgBrowser3
;
2062 eb
->IObjectWithSite_iface
.lpVtbl
= &vt_IObjectWithSite
;
2063 eb
->INameSpaceTreeControlEvents_iface
.lpVtbl
= &vt_INameSpaceTreeControlEvents
;
2064 eb
->IInputObject_iface
.lpVtbl
= &vt_IInputObject
;
2066 /* Default settings */
2067 eb
->navpane
.width
= 150;
2068 eb
->navpane
.show
= TRUE
;
2070 list_init(&eb
->event_clients
);
2071 list_init(&eb
->travellog
);
2073 ret
= IExplorerBrowser_QueryInterface(&eb
->IExplorerBrowser_iface
, riid
, ppv
);
2074 IExplorerBrowser_Release(&eb
->IExplorerBrowser_iface
);
2076 TRACE("--(%p)\n", ppv
);