2 * Implementation of IWebBrowser interface for WebBrowser control
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
5 * Copyright 2005 Jacek Caban
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(ieframe
);
31 static inline WebBrowser
*impl_from_IWebBrowser2(IWebBrowser2
*iface
)
33 return CONTAINING_RECORD(iface
, WebBrowser
, IWebBrowser2_iface
);
36 static HRESULT WINAPI
WebBrowser_QueryInterface(IWebBrowser2
*iface
, REFIID riid
, LPVOID
*ppv
)
38 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
44 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
45 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
46 *ppv
= &This
->IWebBrowser2_iface
;
47 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
48 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
49 *ppv
= &This
->IWebBrowser2_iface
;
50 }else if(IsEqualGUID(&IID_IWebBrowser
, riid
)) {
51 TRACE("(%p)->(IID_IWebBrowser %p)\n", This
, ppv
);
52 *ppv
= &This
->IWebBrowser2_iface
;
53 }else if(IsEqualGUID(&IID_IWebBrowserApp
, riid
)) {
54 TRACE("(%p)->(IID_IWebBrowserApp %p)\n", This
, ppv
);
55 *ppv
= &This
->IWebBrowser2_iface
;
56 }else if(IsEqualGUID(&IID_IWebBrowser2
, riid
)) {
57 TRACE("(%p)->(IID_IWebBrowser2 %p)\n", This
, ppv
);
58 *ppv
= &This
->IWebBrowser2_iface
;
59 }else if(IsEqualGUID(&IID_IOleObject
, riid
)) {
60 TRACE("(%p)->(IID_IOleObject %p)\n", This
, ppv
);
61 *ppv
= &This
->IOleObject_iface
;
62 }else if(IsEqualGUID(&IID_IOleWindow
, riid
)) {
63 TRACE("(%p)->(IID_IOleWindow %p)\n", This
, ppv
);
64 *ppv
= &This
->IOleInPlaceObject_iface
;
65 }else if(IsEqualGUID (&IID_IOleInPlaceObject
, riid
)) {
66 TRACE("(%p)->(IID_IOleInPlaceObject %p)\n", This
, ppv
);
67 *ppv
= &This
->IOleInPlaceObject_iface
;
68 }else if(IsEqualGUID(&IID_IOleControl
, riid
)) {
69 TRACE("(%p)->(IID_IOleControl %p)\n", This
, ppv
);
70 *ppv
= &This
->IOleControl_iface
;
71 }else if(IsEqualGUID(&IID_IPersist
, riid
)) {
72 TRACE("(%p)->(IID_IPersist %p)\n", This
, ppv
);
73 *ppv
= &This
->IPersistStorage_iface
;
74 }else if(IsEqualGUID(&IID_IPersistStorage
, riid
)) {
75 TRACE("(%p)->(IID_IPersistStorage %p)\n", This
, ppv
);
76 *ppv
= &This
->IPersistStorage_iface
;
77 }else if(IsEqualGUID(&IID_IPersistMemory
, riid
)) {
78 TRACE("(%p)->(IID_IPersistStorage %p)\n", This
, ppv
);
79 *ppv
= &This
->IPersistMemory_iface
;
80 }else if(IsEqualGUID (&IID_IPersistStreamInit
, riid
)) {
81 TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This
, ppv
);
82 *ppv
= &This
->IPersistStreamInit_iface
;
83 }else if(IsEqualGUID(&IID_IProvideClassInfo
, riid
)) {
84 TRACE("(%p)->(IID_IProvideClassInfo %p)\n", This
, ppv
);
85 *ppv
= &This
->IProvideClassInfo2_iface
;
86 }else if(IsEqualGUID(&IID_IProvideClassInfo2
, riid
)) {
87 TRACE("(%p)->(IID_IProvideClassInfo2 %p)\n", This
, ppv
);
88 *ppv
= &This
->IProvideClassInfo2_iface
;
89 }else if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
)) {
90 TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This
, ppv
);
91 *ppv
= &This
->doc_host
.cps
.IConnectionPointContainer_iface
;
92 }else if(IsEqualGUID(&IID_IViewObject
, riid
)) {
93 TRACE("(%p)->(IID_IViewObject %p)\n", This
, ppv
);
94 *ppv
= &This
->IViewObject2_iface
;
95 }else if(IsEqualGUID(&IID_IViewObject2
, riid
)) {
96 TRACE("(%p)->(IID_IViewObject2 %p)\n", This
, ppv
);
97 *ppv
= &This
->IViewObject2_iface
;
98 }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject
, riid
)) {
99 TRACE("(%p)->(IID_IOleInPlaceActiveObject %p)\n", This
, ppv
);
100 *ppv
= &This
->IOleInPlaceActiveObject_iface
;
101 }else if(IsEqualGUID(&IID_IOleCommandTarget
, riid
)) {
102 TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This
, ppv
);
103 *ppv
= &This
->IOleCommandTarget_iface
;
104 }else if(IsEqualGUID(&IID_IServiceProvider
, riid
)) {
105 *ppv
= &This
->IServiceProvider_iface
;
106 TRACE("(%p)->(IID_IServiceProvider %p)\n", This
, ppv
);
107 }else if(IsEqualGUID(&IID_IDataObject
, riid
)) {
108 *ppv
= &This
->IDataObject_iface
;
109 TRACE("(%p)->(IID_IDataObject %p)\n", This
, ppv
);
110 }else if(IsEqualGUID(&IID_IQuickActivate
, riid
)) {
111 TRACE("(%p)->(IID_IQuickActivate %p) returning NULL\n", This
, ppv
);
112 return E_NOINTERFACE
;
113 }else if(IsEqualGUID(&IID_IRunnableObject
, riid
)) {
114 TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This
, ppv
);
115 return E_NOINTERFACE
;
116 }else if(IsEqualGUID(&IID_IPerPropertyBrowsing
, riid
)) {
117 TRACE("(%p)->(IID_IPerPropertyBrowsing %p) returning NULL\n", This
, ppv
);
118 return E_NOINTERFACE
;
119 }else if(IsEqualGUID(&IID_IOleCache
, riid
)) {
120 TRACE("(%p)->(IID_IOleCache %p) returning NULL\n", This
, ppv
);
121 return E_NOINTERFACE
;
122 }else if(IsEqualGUID(&IID_IOleInPlaceSite
, riid
)) {
123 TRACE("(%p)->(IID_IOleInPlaceSite %p) returning NULL\n", This
, ppv
);
124 return E_NOINTERFACE
;
125 }else if(IsEqualGUID(&IID_IObjectWithSite
, riid
)) {
126 TRACE("(%p)->(IID_IObjectWithSite %p) returning NULL\n", This
, ppv
);
127 return E_NOINTERFACE
;
128 }else if(IsEqualGUID(&IID_IViewObjectEx
, riid
)) {
129 TRACE("(%p)->(IID_IViewObjectEx %p) returning NULL\n", This
, ppv
);
130 return E_NOINTERFACE
;
131 }else if(IsEqualGUID(&IID_IOleLink
, riid
)) {
132 TRACE("(%p)->(IID_IOleLink %p) returning NULL\n", This
, ppv
);
133 return E_NOINTERFACE
;
134 }else if(IsEqualGUID(&IID_IMarshal
, riid
)) {
135 TRACE("(%p)->(IID_IMarshal %p) returning NULL\n", This
, ppv
);
136 return E_NOINTERFACE
;
137 }else if(IsEqualGUID(&IID_IStdMarshalInfo
, riid
)) {
138 /* This is implemented since IE10 */
139 WARN("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This
, ppv
);
140 return E_NOINTERFACE
;
141 }else if(HlinkFrame_QI(&This
->hlink_frame
, riid
, ppv
)) {
146 IUnknown_AddRef((IUnknown
*)*ppv
);
150 FIXME("(%p)->(%s %p) interface not supported\n", This
, debugstr_guid(riid
), ppv
);
151 return E_NOINTERFACE
;
154 static ULONG WINAPI
WebBrowser_AddRef(IWebBrowser2
*iface
)
156 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
157 LONG ref
= InterlockedIncrement(&This
->ref
);
158 TRACE("(%p) ref=%d\n", This
, ref
);
162 static ULONG WINAPI
WebBrowser_Release(IWebBrowser2
*iface
)
164 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
165 LONG ref
= InterlockedDecrement(&This
->ref
);
167 TRACE("(%p) ref=%d\n", This
, ref
);
170 if(This
->doc_host
.document
)
171 IUnknown_Release(This
->doc_host
.document
);
173 DocHost_Release(&This
->doc_host
);
175 WebBrowser_OleObject_Destroy(This
);
184 /* IDispatch methods */
185 static HRESULT WINAPI
WebBrowser_GetTypeInfoCount(IWebBrowser2
*iface
, UINT
*pctinfo
)
187 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
189 TRACE("(%p)->(%p)\n", This
, pctinfo
);
195 static HRESULT WINAPI
WebBrowser_GetTypeInfo(IWebBrowser2
*iface
, UINT iTInfo
, LCID lcid
,
198 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
202 TRACE("(%p)->(%d %d %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
204 hres
= get_typeinfo(IWebBrowser2_tid
, &typeinfo
);
208 ITypeInfo_AddRef(typeinfo
);
213 static HRESULT WINAPI
WebBrowser_GetIDsOfNames(IWebBrowser2
*iface
, REFIID riid
,
214 LPOLESTR
*rgszNames
, UINT cNames
,
215 LCID lcid
, DISPID
*rgDispId
)
217 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
221 TRACE("(%p)->(%s %p %d %d %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
224 hres
= get_typeinfo(IWebBrowser2_tid
, &typeinfo
);
228 return ITypeInfo_GetIDsOfNames(typeinfo
, rgszNames
, cNames
, rgDispId
);
231 static HRESULT WINAPI
WebBrowser_Invoke(IWebBrowser2
*iface
, DISPID dispIdMember
,
232 REFIID riid
, LCID lcid
, WORD wFlags
,
233 DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
234 EXCEPINFO
*pExepInfo
, UINT
*puArgErr
)
236 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
240 TRACE("(%p)->(%d %s %d %08x %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
241 lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
243 hres
= get_typeinfo(IWebBrowser2_tid
, &typeinfo
);
247 return ITypeInfo_Invoke(typeinfo
, &This
->IWebBrowser2_iface
, dispIdMember
, wFlags
, pDispParams
,
248 pVarResult
, pExepInfo
, puArgErr
);
251 /* IWebBrowser methods */
252 static HRESULT WINAPI
WebBrowser_GoBack(IWebBrowser2
*iface
)
254 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
255 TRACE("(%p)\n", This
);
256 return go_back(&This
->doc_host
);
259 static HRESULT WINAPI
WebBrowser_GoForward(IWebBrowser2
*iface
)
261 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
262 TRACE("(%p)\n", This
);
263 return go_forward(&This
->doc_host
);
266 static HRESULT WINAPI
WebBrowser_GoHome(IWebBrowser2
*iface
)
268 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
269 TRACE("(%p)\n", This
);
270 return go_home(&This
->doc_host
);
273 static HRESULT WINAPI
WebBrowser_GoSearch(IWebBrowser2
*iface
)
275 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
276 FIXME("(%p)\n", This
);
280 static HRESULT WINAPI
WebBrowser_Navigate(IWebBrowser2
*iface
, BSTR szUrl
,
281 VARIANT
*Flags
, VARIANT
*TargetFrameName
,
282 VARIANT
*PostData
, VARIANT
*Headers
)
284 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
286 TRACE("(%p)->(%s %s %s %s %s)\n", This
, debugstr_w(szUrl
), debugstr_variant(Flags
),
287 debugstr_variant(TargetFrameName
), debugstr_variant(PostData
),
288 debugstr_variant(Headers
));
290 return navigate_url(&This
->doc_host
, szUrl
, Flags
, TargetFrameName
, PostData
, Headers
);
293 static HRESULT WINAPI
WebBrowser_Refresh(IWebBrowser2
*iface
)
295 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
297 TRACE("(%p)\n", This
);
299 return refresh_document(&This
->doc_host
, NULL
);
302 static HRESULT WINAPI
WebBrowser_Refresh2(IWebBrowser2
*iface
, VARIANT
*Level
)
304 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
306 TRACE("(%p)->(%s)\n", This
, debugstr_variant(Level
));
308 return refresh_document(&This
->doc_host
, Level
);
311 static HRESULT WINAPI
WebBrowser_Stop(IWebBrowser2
*iface
)
313 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
314 FIXME("(%p)\n", This
);
318 static HRESULT WINAPI
WebBrowser_get_Application(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
320 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
322 TRACE("(%p)->(%p)\n", This
, ppDisp
);
327 *ppDisp
= (IDispatch
*)&This
->IWebBrowser2_iface
;
328 IDispatch_AddRef(*ppDisp
);
332 static HRESULT WINAPI
WebBrowser_get_Parent(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
334 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
335 FIXME("(%p)->(%p)\n", This
, ppDisp
);
339 static HRESULT WINAPI
WebBrowser_get_Container(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
341 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
342 FIXME("(%p)->(%p)\n", This
, ppDisp
);
346 static HRESULT WINAPI
WebBrowser_get_Document(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
348 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
349 IDispatch
*disp
= NULL
;
351 TRACE("(%p)->(%p)\n", This
, ppDisp
);
353 if(This
->doc_host
.document
) {
356 hres
= IUnknown_QueryInterface(This
->doc_host
.document
, &IID_IDispatch
, (void**)&disp
);
357 if(SUCCEEDED(hres
)) {
360 /* Some broken apps cast returned IDispatch to IHTMLDocument2
361 * without QueryInterface call */
362 hres
= IDispatch_QueryInterface(disp
, &IID_IHTMLDocument2
, (void**)&html_doc
);
363 if(SUCCEEDED(hres
)) {
364 IDispatch_Release(disp
);
374 static HRESULT WINAPI
WebBrowser_get_TopLevelContainer(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
376 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
377 FIXME("(%p)->(%p)\n", This
, pBool
);
381 static HRESULT WINAPI
WebBrowser_get_Type(IWebBrowser2
*iface
, BSTR
*Type
)
383 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
384 FIXME("(%p)->(%p)\n", This
, Type
);
388 static HRESULT WINAPI
WebBrowser_get_Left(IWebBrowser2
*iface
, LONG
*pl
)
390 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
392 TRACE("(%p)->(%p)\n", This
, pl
);
394 *pl
= This
->pos_rect
.left
;
398 static HRESULT WINAPI
WebBrowser_put_Left(IWebBrowser2
*iface
, LONG Left
)
400 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
403 TRACE("(%p)->(%d)\n", This
, Left
);
408 rect
= This
->pos_rect
;
411 /* We don't really change the window position here.
412 * We just notify the embedder that he should do so. */
413 return IOleInPlaceSiteEx_OnPosRectChange(This
->inplace
, &rect
);
416 static HRESULT WINAPI
WebBrowser_get_Top(IWebBrowser2
*iface
, LONG
*pl
)
418 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
420 TRACE("(%p)->(%p)\n", This
, pl
);
422 *pl
= This
->pos_rect
.top
;
426 static HRESULT WINAPI
WebBrowser_put_Top(IWebBrowser2
*iface
, LONG Top
)
428 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
431 TRACE("(%p)->(%d)\n", This
, Top
);
436 rect
= This
->pos_rect
;
439 /* We don't really change the window position here.
440 * We just notify the embedder that he should do so. */
441 return IOleInPlaceSiteEx_OnPosRectChange(This
->inplace
, &rect
);
444 static HRESULT WINAPI
WebBrowser_get_Width(IWebBrowser2
*iface
, LONG
*pl
)
446 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
448 TRACE("(%p)->(%p)\n", This
, pl
);
450 *pl
= This
->pos_rect
.right
- This
->pos_rect
.left
;
454 static HRESULT WINAPI
WebBrowser_put_Width(IWebBrowser2
*iface
, LONG Width
)
456 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
459 TRACE("(%p)->(%d)\n", This
, Width
);
464 rect
= This
->pos_rect
;
465 rect
.right
= rect
.left
+Width
;
467 /* We don't really change the window size here.
468 * We just notify the embedder that he should do so. */
469 return IOleInPlaceSiteEx_OnPosRectChange(This
->inplace
, &rect
);
472 static HRESULT WINAPI
WebBrowser_get_Height(IWebBrowser2
*iface
, LONG
*pl
)
474 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
476 TRACE("(%p)->(%p)\n", This
, pl
);
478 *pl
= This
->pos_rect
.bottom
- This
->pos_rect
.top
;
482 static HRESULT WINAPI
WebBrowser_put_Height(IWebBrowser2
*iface
, LONG Height
)
484 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
487 TRACE("(%p)->(%d)\n", This
, Height
);
492 rect
= This
->pos_rect
;
493 rect
.bottom
= rect
.top
+Height
;
495 /* We don't really change the window size here.
496 * We just notify the embedder that he should do so. */
497 return IOleInPlaceSiteEx_OnPosRectChange(This
->inplace
, &rect
);
500 static HRESULT WINAPI
WebBrowser_get_LocationName(IWebBrowser2
*iface
, BSTR
*LocationName
)
502 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
503 FIXME("(%p)->(%p)\n", This
, LocationName
);
507 static HRESULT WINAPI
WebBrowser_get_LocationURL(IWebBrowser2
*iface
, BSTR
*LocationURL
)
509 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
511 TRACE("(%p)->(%p)\n", This
, LocationURL
);
513 return get_location_url(&This
->doc_host
, LocationURL
);
516 static HRESULT WINAPI
WebBrowser_get_Busy(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
518 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
520 TRACE("(%p)->(%p)\n", This
, pBool
);
522 *pBool
= This
->doc_host
.busy
;
526 static HRESULT WINAPI
WebBrowser_Quit(IWebBrowser2
*iface
)
528 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
530 TRACE("(%p)\n", This
);
532 /* It's a InternetExplorer specific method, we have nothing to do here. */
536 static HRESULT WINAPI
WebBrowser_ClientToWindow(IWebBrowser2
*iface
, int *pcx
, int *pcy
)
538 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
539 FIXME("(%p)->(%p %p)\n", This
, pcx
, pcy
);
543 static HRESULT WINAPI
WebBrowser_PutProperty(IWebBrowser2
*iface
, BSTR szProperty
, VARIANT vtValue
)
545 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
546 FIXME("(%p)->(%s %s)\n", This
, debugstr_w(szProperty
), debugstr_variant(&vtValue
));
550 static HRESULT WINAPI
WebBrowser_GetProperty(IWebBrowser2
*iface
, BSTR szProperty
, VARIANT
*pvtValue
)
552 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
553 FIXME("(%p)->(%s %s)\n", This
, debugstr_w(szProperty
), debugstr_variant(pvtValue
));
557 static HRESULT WINAPI
WebBrowser_get_Name(IWebBrowser2
*iface
, BSTR
*Name
)
559 static const WCHAR sName
[] = {'M','i','c','r','o','s','o','f','t',' ','W','e','b',
560 ' ','B','r','o','w','s','e','r',' ','C','o','n','t','r','o','l',0};
561 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
563 TRACE("(%p)->(%p)\n", This
, Name
);
565 *Name
= SysAllocString(sName
);
570 static HRESULT WINAPI
WebBrowser_get_HWND(IWebBrowser2
*iface
, SHANDLE_PTR
*pHWND
)
572 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
574 TRACE("(%p)->(%p)\n", This
, pHWND
);
576 /* WebBrowser control never has a frame window (in opposition to InternetExplorer) */
581 static HRESULT WINAPI
WebBrowser_get_FullName(IWebBrowser2
*iface
, BSTR
*FullName
)
583 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
584 FIXME("(%p)->(%p)\n", This
, FullName
);
588 static HRESULT WINAPI
WebBrowser_get_Path(IWebBrowser2
*iface
, BSTR
*Path
)
590 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
591 FIXME("(%p)->(%p)\n", This
, Path
);
595 static HRESULT WINAPI
WebBrowser_get_Visible(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
597 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
599 TRACE("(%p)->(%p)\n", This
, pBool
);
601 *pBool
= This
->visible
;
605 static HRESULT WINAPI
WebBrowser_put_Visible(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
607 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
609 DISPPARAMS dispparams
= {&arg
, NULL
, 1, 0};
611 TRACE("(%p)->(%x)\n", This
, Value
);
613 This
->visible
= Value
;
615 V_VT(&arg
) = VT_BOOL
;
616 V_BOOL(&arg
) = Value
;
617 call_sink(This
->doc_host
.cps
.wbe2
, DISPID_ONVISIBLE
, &dispparams
);
622 static HRESULT WINAPI
WebBrowser_get_StatusBar(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
624 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
626 TRACE("(%p)->(%p)\n", This
, pBool
);
628 *pBool
= This
->status_bar
;
632 static HRESULT WINAPI
WebBrowser_put_StatusBar(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
634 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
636 DISPPARAMS dispparams
= {&arg
, NULL
, 1, 0};
638 TRACE("(%p)->(%x)\n", This
, Value
);
640 This
->status_bar
= Value
? VARIANT_TRUE
: VARIANT_FALSE
;
642 /* In opposition to InternetExplorer, all we should do here is
643 * inform the embedder about the status bar change. */
645 V_VT(&arg
) = VT_BOOL
;
646 V_BOOL(&arg
) = Value
;
647 call_sink(This
->doc_host
.cps
.wbe2
, DISPID_ONSTATUSBAR
, &dispparams
);
652 static HRESULT WINAPI
WebBrowser_get_StatusText(IWebBrowser2
*iface
, BSTR
*StatusText
)
654 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
655 FIXME("(%p)->(%p)\n", This
, StatusText
);
659 static HRESULT WINAPI
WebBrowser_put_StatusText(IWebBrowser2
*iface
, BSTR StatusText
)
661 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
662 FIXME("(%p)->(%s)\n", This
, debugstr_w(StatusText
));
666 static HRESULT WINAPI
WebBrowser_get_ToolBar(IWebBrowser2
*iface
, int *Value
)
668 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
670 TRACE("(%p)->(%p)\n", This
, Value
);
672 *Value
= This
->tool_bar
;
676 static HRESULT WINAPI
WebBrowser_put_ToolBar(IWebBrowser2
*iface
, int Value
)
678 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
680 DISPPARAMS dispparams
= {&arg
, NULL
, 1, 0};
682 TRACE("(%p)->(%x)\n", This
, Value
);
684 This
->tool_bar
= Value
? VARIANT_TRUE
: VARIANT_FALSE
;
686 /* In opposition to InternetExplorer, all we should do here is
687 * inform the embedder about the tool bar change. */
689 V_VT(&arg
) = VT_BOOL
;
690 V_BOOL(&arg
) = This
->tool_bar
;
691 call_sink(This
->doc_host
.cps
.wbe2
, DISPID_ONTOOLBAR
, &dispparams
);
696 static HRESULT WINAPI
WebBrowser_get_MenuBar(IWebBrowser2
*iface
, VARIANT_BOOL
*Value
)
698 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
700 TRACE("(%p)->(%p)\n", This
, Value
);
702 *Value
= This
->menu_bar
;
706 static HRESULT WINAPI
WebBrowser_put_MenuBar(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
708 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
710 DISPPARAMS dispparams
= {&arg
, NULL
, 1, 0};
712 TRACE("(%p)->(%x)\n", This
, Value
);
714 This
->menu_bar
= Value
? VARIANT_TRUE
: VARIANT_FALSE
;
716 /* In opposition to InternetExplorer, all we should do here is
717 * inform the embedder about the menu bar change. */
719 V_VT(&arg
) = VT_BOOL
;
720 V_BOOL(&arg
) = Value
;
721 call_sink(This
->doc_host
.cps
.wbe2
, DISPID_ONMENUBAR
, &dispparams
);
726 static HRESULT WINAPI
WebBrowser_get_FullScreen(IWebBrowser2
*iface
, VARIANT_BOOL
*pbFullScreen
)
728 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
730 TRACE("(%p)->(%p)\n", This
, pbFullScreen
);
732 *pbFullScreen
= This
->full_screen
;
736 static HRESULT WINAPI
WebBrowser_put_FullScreen(IWebBrowser2
*iface
, VARIANT_BOOL bFullScreen
)
738 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
740 DISPPARAMS dispparams
= {&arg
, NULL
, 1, 0};
742 /* In opposition to InternetExplorer, all we should do here is
743 * inform the embedder about the fullscreen change. */
745 TRACE("(%p)->(%x)\n", This
, bFullScreen
);
747 This
->full_screen
= bFullScreen
? VARIANT_TRUE
: VARIANT_FALSE
;
749 V_VT(&arg
) = VT_BOOL
;
750 V_BOOL(&arg
) = bFullScreen
;
751 call_sink(This
->doc_host
.cps
.wbe2
, DISPID_ONFULLSCREEN
, &dispparams
);
756 static HRESULT WINAPI
WebBrowser_Navigate2(IWebBrowser2
*iface
, VARIANT
*URL
, VARIANT
*Flags
,
757 VARIANT
*TargetFrameName
, VARIANT
*PostData
, VARIANT
*Headers
)
759 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
762 TRACE("(%p)->(%s %s %s %s %s)\n", This
, debugstr_variant(URL
), debugstr_variant(Flags
),
763 debugstr_variant(TargetFrameName
), debugstr_variant(PostData
), debugstr_variant(Headers
));
776 case VT_BSTR
|VT_BYREF
:
777 url
= *V_BSTRREF(URL
);
780 FIXME("Unsupported V_VT(URL) %d\n", V_VT(URL
));
784 return navigate_url(&This
->doc_host
, url
, Flags
, TargetFrameName
, PostData
, Headers
);
787 static HRESULT WINAPI
WebBrowser_QueryStatusWB(IWebBrowser2
*iface
, OLECMDID cmdID
, OLECMDF
*pcmdf
)
789 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
790 IOleCommandTarget
*target
= NULL
;
791 OLECMD ole_command
[1];
794 TRACE("(%p)->(%d %p)\n", This
, cmdID
, pcmdf
);
798 ole_command
[0].cmdID
= cmdID
;
799 ole_command
[0].cmdf
= *pcmdf
;
803 hres
= IOleContainer_QueryInterface(This
->container
, &IID_IOleCommandTarget
, (LPVOID
*)&target
);
807 if (!target
&& This
->doc_host
.document
)
809 hres
= IUnknown_QueryInterface(This
->doc_host
.document
, &IID_IOleCommandTarget
, (LPVOID
*)&target
);
817 hres
= IOleCommandTarget_QueryStatus(target
, NULL
, 1, ole_command
, NULL
);
819 *pcmdf
= ole_command
[0].cmdf
;
820 if (hres
== OLECMDERR_E_NOTSUPPORTED
)
825 IOleCommandTarget_Release(target
);
830 static HRESULT WINAPI
WebBrowser_ExecWB(IWebBrowser2
*iface
, OLECMDID cmdID
,
831 OLECMDEXECOPT cmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
)
833 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
834 IOleCommandTarget
*target
= NULL
;
837 TRACE("(%p)->(%d %d %s %p)\n", This
, cmdID
, cmdexecopt
, debugstr_variant(pvaIn
), pvaOut
);
841 hres
= IOleContainer_QueryInterface(This
->container
, &IID_IOleCommandTarget
, (LPVOID
*)&target
);
845 if(!target
&& This
->doc_host
.document
)
847 hres
= IUnknown_QueryInterface(This
->doc_host
.document
, &IID_IOleCommandTarget
, (LPVOID
*)&target
);
855 hres
= IOleCommandTarget_Exec(target
, NULL
, cmdID
, cmdexecopt
, pvaIn
, pvaOut
);
856 IOleCommandTarget_Release(target
);
861 static HRESULT WINAPI
WebBrowser_ShowBrowserBar(IWebBrowser2
*iface
, VARIANT
*pvaClsid
,
862 VARIANT
*pvarShow
, VARIANT
*pvarSize
)
864 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
865 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_variant(pvaClsid
), debugstr_variant(pvarShow
),
866 debugstr_variant(pvarSize
));
870 static HRESULT WINAPI
WebBrowser_get_ReadyState(IWebBrowser2
*iface
, READYSTATE
*lpReadyState
)
872 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
874 TRACE("(%p)->(%p)\n", This
, lpReadyState
);
876 *lpReadyState
= This
->doc_host
.ready_state
;
880 static HRESULT WINAPI
WebBrowser_get_Offline(IWebBrowser2
*iface
, VARIANT_BOOL
*pbOffline
)
882 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
884 TRACE("(%p)->(%p)\n", This
, pbOffline
);
886 *pbOffline
= This
->doc_host
.offline
;
890 static HRESULT WINAPI
WebBrowser_put_Offline(IWebBrowser2
*iface
, VARIANT_BOOL bOffline
)
892 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
894 TRACE("(%p)->(%x)\n", This
, bOffline
);
896 This
->doc_host
.offline
= bOffline
? VARIANT_TRUE
: VARIANT_FALSE
;
900 static HRESULT WINAPI
WebBrowser_get_Silent(IWebBrowser2
*iface
, VARIANT_BOOL
*pbSilent
)
902 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
904 TRACE("(%p)->(%p)\n", This
, pbSilent
);
906 *pbSilent
= This
->doc_host
.silent
;
910 static HRESULT WINAPI
WebBrowser_put_Silent(IWebBrowser2
*iface
, VARIANT_BOOL bSilent
)
912 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
914 TRACE("(%p)->(%x)\n", This
, bSilent
);
916 This
->doc_host
.silent
= bSilent
? VARIANT_TRUE
: VARIANT_FALSE
;
920 static HRESULT WINAPI
WebBrowser_get_RegisterAsBrowser(IWebBrowser2
*iface
,
921 VARIANT_BOOL
*pbRegister
)
923 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
925 FIXME("(%p)->(%p)\n", This
, pbRegister
);
927 *pbRegister
= This
->register_browser
;
931 static HRESULT WINAPI
WebBrowser_put_RegisterAsBrowser(IWebBrowser2
*iface
,
932 VARIANT_BOOL bRegister
)
934 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
936 FIXME("(%p)->(%x)\n", This
, bRegister
);
938 This
->register_browser
= bRegister
? VARIANT_TRUE
: VARIANT_FALSE
;
942 static HRESULT WINAPI
WebBrowser_get_RegisterAsDropTarget(IWebBrowser2
*iface
,
943 VARIANT_BOOL
*pbRegister
)
945 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
947 FIXME("(%p)->(%p)\n", This
, pbRegister
);
956 static HRESULT WINAPI
WebBrowser_put_RegisterAsDropTarget(IWebBrowser2
*iface
,
957 VARIANT_BOOL bRegister
)
959 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
960 FIXME("(%p)->(%x)\n", This
, bRegister
);
964 static HRESULT WINAPI
WebBrowser_get_TheaterMode(IWebBrowser2
*iface
, VARIANT_BOOL
*pbRegister
)
966 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
968 TRACE("(%p)->(%p)\n", This
, pbRegister
);
970 *pbRegister
= This
->theater_mode
;
974 static HRESULT WINAPI
WebBrowser_put_TheaterMode(IWebBrowser2
*iface
, VARIANT_BOOL bRegister
)
976 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
978 DISPPARAMS dispparams
= {&arg
, NULL
, 1, 0};
980 TRACE("(%p)->(%x)\n", This
, bRegister
);
982 This
->theater_mode
= bRegister
? VARIANT_TRUE
: VARIANT_FALSE
;
984 /* In opposition to InternetExplorer, all we should do here is
985 * inform the embedder about the theater mode change. */
987 V_VT(&arg
) = VT_BOOL
;
988 V_BOOL(&arg
) = bRegister
;
989 call_sink(This
->doc_host
.cps
.wbe2
, DISPID_ONTHEATERMODE
, &dispparams
);
994 static HRESULT WINAPI
WebBrowser_get_AddressBar(IWebBrowser2
*iface
, VARIANT_BOOL
*Value
)
996 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
998 TRACE("(%p)->(%p)\n", This
, Value
);
1000 *Value
= This
->address_bar
;
1004 static HRESULT WINAPI
WebBrowser_put_AddressBar(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
1006 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
1008 DISPPARAMS dispparams
= {&arg
, NULL
, 1, 0};
1010 TRACE("(%p)->(%x)\n", This
, Value
);
1012 This
->address_bar
= Value
? VARIANT_TRUE
: VARIANT_FALSE
;
1014 /* In opposition to InternetExplorer, all we should do here is
1015 * inform the embedder about the address bar change. */
1017 V_VT(&arg
) = VT_BOOL
;
1018 V_BOOL(&arg
) = Value
;
1019 call_sink(This
->doc_host
.cps
.wbe2
, DISPID_ONADDRESSBAR
, &dispparams
);
1024 static HRESULT WINAPI
WebBrowser_get_Resizable(IWebBrowser2
*iface
, VARIANT_BOOL
*Value
)
1026 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
1028 TRACE("(%p)->(%p)\n", This
, Value
);
1030 /* It's InternetExplorer object's method. We have nothing to do here. */
1034 static HRESULT WINAPI
WebBrowser_put_Resizable(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
1036 WebBrowser
*This
= impl_from_IWebBrowser2(iface
);
1038 DISPPARAMS dispparams
= {&arg
, NULL
, 1, 0};
1040 TRACE("(%p)->(%x)\n", This
, Value
);
1042 /* In opposition to InternetExplorer, all we should do here is
1043 * inform the embedder about the resizable change. */
1045 V_VT(&arg
) = VT_BOOL
;
1046 V_BOOL(&arg
) = Value
;
1047 call_sink(This
->doc_host
.cps
.wbe2
, DISPID_WINDOWSETRESIZABLE
, &dispparams
);
1052 static const IWebBrowser2Vtbl WebBrowser2Vtbl
=
1054 WebBrowser_QueryInterface
,
1057 WebBrowser_GetTypeInfoCount
,
1058 WebBrowser_GetTypeInfo
,
1059 WebBrowser_GetIDsOfNames
,
1062 WebBrowser_GoForward
,
1064 WebBrowser_GoSearch
,
1065 WebBrowser_Navigate
,
1067 WebBrowser_Refresh2
,
1069 WebBrowser_get_Application
,
1070 WebBrowser_get_Parent
,
1071 WebBrowser_get_Container
,
1072 WebBrowser_get_Document
,
1073 WebBrowser_get_TopLevelContainer
,
1074 WebBrowser_get_Type
,
1075 WebBrowser_get_Left
,
1076 WebBrowser_put_Left
,
1079 WebBrowser_get_Width
,
1080 WebBrowser_put_Width
,
1081 WebBrowser_get_Height
,
1082 WebBrowser_put_Height
,
1083 WebBrowser_get_LocationName
,
1084 WebBrowser_get_LocationURL
,
1085 WebBrowser_get_Busy
,
1087 WebBrowser_ClientToWindow
,
1088 WebBrowser_PutProperty
,
1089 WebBrowser_GetProperty
,
1090 WebBrowser_get_Name
,
1091 WebBrowser_get_HWND
,
1092 WebBrowser_get_FullName
,
1093 WebBrowser_get_Path
,
1094 WebBrowser_get_Visible
,
1095 WebBrowser_put_Visible
,
1096 WebBrowser_get_StatusBar
,
1097 WebBrowser_put_StatusBar
,
1098 WebBrowser_get_StatusText
,
1099 WebBrowser_put_StatusText
,
1100 WebBrowser_get_ToolBar
,
1101 WebBrowser_put_ToolBar
,
1102 WebBrowser_get_MenuBar
,
1103 WebBrowser_put_MenuBar
,
1104 WebBrowser_get_FullScreen
,
1105 WebBrowser_put_FullScreen
,
1106 WebBrowser_Navigate2
,
1107 WebBrowser_QueryStatusWB
,
1109 WebBrowser_ShowBrowserBar
,
1110 WebBrowser_get_ReadyState
,
1111 WebBrowser_get_Offline
,
1112 WebBrowser_put_Offline
,
1113 WebBrowser_get_Silent
,
1114 WebBrowser_put_Silent
,
1115 WebBrowser_get_RegisterAsBrowser
,
1116 WebBrowser_put_RegisterAsBrowser
,
1117 WebBrowser_get_RegisterAsDropTarget
,
1118 WebBrowser_put_RegisterAsDropTarget
,
1119 WebBrowser_get_TheaterMode
,
1120 WebBrowser_put_TheaterMode
,
1121 WebBrowser_get_AddressBar
,
1122 WebBrowser_put_AddressBar
,
1123 WebBrowser_get_Resizable
,
1124 WebBrowser_put_Resizable
1127 static inline WebBrowser
*impl_from_IServiceProvider(IServiceProvider
*iface
)
1129 return CONTAINING_RECORD(iface
, WebBrowser
, IServiceProvider_iface
);
1132 static HRESULT WINAPI
WBServiceProvider_QueryInterface(IServiceProvider
*iface
,
1133 REFIID riid
, LPVOID
*ppv
)
1135 WebBrowser
*This
= impl_from_IServiceProvider(iface
);
1136 return IWebBrowser2_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppv
);
1139 static ULONG WINAPI
WBServiceProvider_AddRef(IServiceProvider
*iface
)
1141 WebBrowser
*This
= impl_from_IServiceProvider(iface
);
1142 return IWebBrowser2_AddRef(&This
->IWebBrowser2_iface
);
1145 static ULONG WINAPI
WBServiceProvider_Release(IServiceProvider
*iface
)
1147 WebBrowser
*This
= impl_from_IServiceProvider(iface
);
1148 return IWebBrowser2_Release(&This
->IWebBrowser2_iface
);
1151 static HRESULT STDMETHODCALLTYPE
WBServiceProvider_QueryService(IServiceProvider
*iface
,
1152 REFGUID guidService
, REFIID riid
, void **ppv
)
1154 WebBrowser
*This
= impl_from_IServiceProvider(iface
);
1156 if(IsEqualGUID(&SID_SHTMLWindow
, riid
)) {
1157 TRACE("(%p)->(SID_SHTMLWindow)\n", This
);
1158 return IHTMLWindow2_QueryInterface(&This
->doc_host
.html_window
.IHTMLWindow2_iface
, riid
, ppv
);
1161 if(IsEqualGUID(&IID_IBrowserService2
, riid
)) {
1162 TRACE("(%p)->(IID_IBrowserService2 return E_FAIL)\n", This
);
1167 FIXME("(%p)->(%s, %s %p)\n", This
, debugstr_guid(guidService
), debugstr_guid(riid
), ppv
);
1169 return E_NOINTERFACE
;
1172 static const IServiceProviderVtbl ServiceProviderVtbl
=
1174 WBServiceProvider_QueryInterface
,
1175 WBServiceProvider_AddRef
,
1176 WBServiceProvider_Release
,
1177 WBServiceProvider_QueryService
1180 static inline WebBrowser
*impl_from_DocHost(DocHost
*iface
)
1182 return CONTAINING_RECORD(iface
, WebBrowser
, doc_host
);
1185 static ULONG
WebBrowser_addref(DocHost
*iface
)
1187 WebBrowser
*This
= impl_from_DocHost(iface
);
1188 return IWebBrowser2_AddRef(&This
->IWebBrowser2_iface
);
1191 static ULONG
WebBrowser_release(DocHost
*iface
)
1193 WebBrowser
*This
= impl_from_DocHost(iface
);
1194 return IWebBrowser2_Release(&This
->IWebBrowser2_iface
);
1197 static void WINAPI
DocHostContainer_GetDocObjRect(DocHost
* This
, RECT
* rc
)
1199 GetClientRect(This
->frame_hwnd
, rc
);
1202 static HRESULT WINAPI
DocHostContainer_SetStatusText(DocHost
* This
, LPCWSTR text
)
1207 static void WINAPI
DocHostContainer_SetURL(DocHost
* This
, LPCWSTR url
)
1212 static HRESULT
DocHostContainer_exec(DocHost
*doc_host
, const GUID
*cmd_group
, DWORD cmdid
, DWORD execopt
, VARIANT
*in
,
1215 WebBrowser
*This
= impl_from_DocHost(doc_host
);
1216 IOleCommandTarget
*cmdtrg
= NULL
;
1220 hres
= IOleClientSite_QueryInterface(This
->client
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
1225 if(!cmdtrg
&& This
->container
) {
1226 hres
= IOleContainer_QueryInterface(This
->container
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
1234 hres
= IOleCommandTarget_Exec(cmdtrg
, cmd_group
, cmdid
, execopt
, in
, out
);
1235 IOleCommandTarget_Release(cmdtrg
);
1237 TRACE("Exec returned %08x %s\n", hres
, debugstr_variant(out
));
1239 FIXME("Exec failed\n");
1244 static const IDocHostContainerVtbl DocHostContainerVtbl
= {
1247 DocHostContainer_GetDocObjRect
,
1248 DocHostContainer_SetStatusText
,
1249 DocHostContainer_SetURL
,
1250 DocHostContainer_exec
1253 static HRESULT
create_webbrowser(int version
, IUnknown
*outer
, REFIID riid
, void **ppv
)
1258 TRACE("(%p %s %p) version=%d\n", outer
, debugstr_guid(riid
), ppv
, version
);
1260 ret
= heap_alloc_zero(sizeof(WebBrowser
));
1262 ret
->IWebBrowser2_iface
.lpVtbl
= &WebBrowser2Vtbl
;
1263 ret
->IServiceProvider_iface
.lpVtbl
= &ServiceProviderVtbl
;
1265 ret
->version
= version
;
1267 DocHost_Init(&ret
->doc_host
, &ret
->IWebBrowser2_iface
, &DocHostContainerVtbl
);
1269 ret
->visible
= VARIANT_TRUE
;
1270 ret
->menu_bar
= VARIANT_TRUE
;
1271 ret
->address_bar
= VARIANT_TRUE
;
1272 ret
->status_bar
= VARIANT_TRUE
;
1273 ret
->tool_bar
= VARIANT_TRUE
;
1275 WebBrowser_OleObject_Init(ret
);
1276 WebBrowser_ViewObject_Init(ret
);
1277 WebBrowser_Persist_Init(ret
);
1278 WebBrowser_ClassInfo_Init(ret
);
1280 HlinkFrame_Init(&ret
->hlink_frame
, (IUnknown
*)&ret
->IWebBrowser2_iface
, &ret
->doc_host
);
1284 hres
= IWebBrowser2_QueryInterface(&ret
->IWebBrowser2_iface
, riid
, ppv
);
1286 IWebBrowser2_Release(&ret
->IWebBrowser2_iface
);
1290 HRESULT WINAPI
WebBrowserV1_Create(IClassFactory
*iface
, IUnknown
*pOuter
, REFIID riid
, void **ppv
)
1292 return create_webbrowser(1, pOuter
, riid
, ppv
);
1295 HRESULT WINAPI
WebBrowser_Create(IClassFactory
*iface
, IUnknown
*pOuter
, REFIID riid
, void **ppv
)
1297 return create_webbrowser(2, pOuter
, riid
, ppv
);