2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 static inline InternetExplorer
*impl_from_IWebBrowser2(IWebBrowser2
*iface
)
23 return CONTAINING_RECORD(iface
, InternetExplorer
, IWebBrowser2_iface
);
26 static HRESULT WINAPI
InternetExplorer_QueryInterface(IWebBrowser2
*iface
, REFIID riid
, LPVOID
*ppv
)
28 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
32 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
33 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
34 *ppv
= &This
->IWebBrowser2_iface
;
35 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
36 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
37 *ppv
= &This
->IWebBrowser2_iface
;
38 }else if(IsEqualGUID(&IID_IWebBrowser
, riid
)) {
39 TRACE("(%p)->(IID_IWebBrowser %p)\n", This
, ppv
);
40 *ppv
= &This
->IWebBrowser2_iface
;
41 }else if(IsEqualGUID(&IID_IWebBrowserApp
, riid
)) {
42 TRACE("(%p)->(IID_IWebBrowserApp %p)\n", This
, ppv
);
43 *ppv
= &This
->IWebBrowser2_iface
;
44 }else if(IsEqualGUID(&IID_IWebBrowser2
, riid
)) {
45 TRACE("(%p)->(IID_IWebBrowser2 %p)\n", This
, ppv
);
46 *ppv
= &This
->IWebBrowser2_iface
;
47 }else if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
)) {
48 TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This
, ppv
);
49 *ppv
= &This
->doc_host
.cps
.IConnectionPointContainer_iface
;
50 }else if(IsEqualGUID(&IID_IExternalConnection
, riid
)) {
51 TRACE("(%p)->(IID_IExternalConnection %p)\n", This
, ppv
);
52 *ppv
= &This
->IExternalConnection_iface
;
53 }else if(IsEqualGUID(&IID_IServiceProvider
, riid
)) {
54 TRACE("(%p)->(IID_IServiceProvider %p)\n", This
, ppv
);
55 *ppv
= &This
->IServiceProvider_iface
;
56 }else if(HlinkFrame_QI(&This
->hlink_frame
, riid
, ppv
)) {
61 IUnknown_AddRef((IUnknown
*)*ppv
);
65 WARN("(%p)->(%s %p) interface not supported\n", This
, debugstr_guid(riid
), ppv
);
69 static ULONG WINAPI
InternetExplorer_AddRef(IWebBrowser2
*iface
)
71 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
72 LONG ref
= InterlockedIncrement(&This
->ref
);
73 TRACE("(%p) ref=%d\n", This
, ref
);
77 static ULONG WINAPI
InternetExplorer_Release(IWebBrowser2
*iface
)
79 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
80 LONG ref
= InterlockedDecrement(&This
->ref
);
82 TRACE("(%p) ref=%d\n", This
, ref
);
85 deactivate_document(&This
->doc_host
);
86 DocHost_Release(&This
->doc_host
);
89 DestroyWindow(This
->frame_hwnd
);
90 list_remove(&This
->entry
);
99 static HRESULT WINAPI
InternetExplorer_GetTypeInfoCount(IWebBrowser2
*iface
, UINT
*pctinfo
)
101 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
102 FIXME("(%p)->(%p)\n", This
, pctinfo
);
106 static HRESULT WINAPI
InternetExplorer_GetTypeInfo(IWebBrowser2
*iface
, UINT iTInfo
, LCID lcid
,
109 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
110 FIXME("(%p)->(%d %d %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
114 static HRESULT WINAPI
InternetExplorer_GetIDsOfNames(IWebBrowser2
*iface
, REFIID riid
,
115 LPOLESTR
*rgszNames
, UINT cNames
,
116 LCID lcid
, DISPID
*rgDispId
)
118 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
119 FIXME("(%p)->(%s %p %d %d %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
124 static HRESULT WINAPI
InternetExplorer_Invoke(IWebBrowser2
*iface
, DISPID dispIdMember
,
125 REFIID riid
, LCID lcid
, WORD wFlags
,
126 DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
127 EXCEPINFO
*pExepInfo
, UINT
*puArgErr
)
129 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
130 FIXME("(%p)->(%d %s %d %08x %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
131 lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
135 static HRESULT WINAPI
InternetExplorer_GoBack(IWebBrowser2
*iface
)
137 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
138 TRACE("(%p)\n", This
);
139 return go_back(&This
->doc_host
);
142 static HRESULT WINAPI
InternetExplorer_GoForward(IWebBrowser2
*iface
)
144 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
145 TRACE("(%p)\n", This
);
146 return go_forward(&This
->doc_host
);
149 static HRESULT WINAPI
InternetExplorer_GoHome(IWebBrowser2
*iface
)
151 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
152 TRACE("(%p)\n", This
);
153 return go_home(&This
->doc_host
);
156 static HRESULT WINAPI
InternetExplorer_GoSearch(IWebBrowser2
*iface
)
158 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
159 FIXME("(%p)\n", This
);
163 static HRESULT WINAPI
InternetExplorer_Navigate(IWebBrowser2
*iface
, BSTR szUrl
,
164 VARIANT
*Flags
, VARIANT
*TargetFrameName
,
165 VARIANT
*PostData
, VARIANT
*Headers
)
167 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
169 TRACE("(%p)->(%s %p %p %p %p)\n", This
, debugstr_w(szUrl
), Flags
, TargetFrameName
,
172 return navigate_url(&This
->doc_host
, szUrl
, Flags
, TargetFrameName
, PostData
, Headers
);
175 static HRESULT WINAPI
InternetExplorer_Refresh(IWebBrowser2
*iface
)
177 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
179 TRACE("(%p)\n", This
);
181 return refresh_document(&This
->doc_host
);
184 static HRESULT WINAPI
InternetExplorer_Refresh2(IWebBrowser2
*iface
, VARIANT
*Level
)
186 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
187 FIXME("(%p)->(%p)\n", This
, Level
);
191 static HRESULT WINAPI
InternetExplorer_Stop(IWebBrowser2
*iface
)
193 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
194 FIXME("(%p)\n", This
);
198 static HRESULT WINAPI
InternetExplorer_get_Application(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
200 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
201 FIXME("(%p)->(%p)\n", This
, ppDisp
);
205 static HRESULT WINAPI
InternetExplorer_get_Parent(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
207 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
208 FIXME("(%p)->(%p)\n", This
, ppDisp
);
212 static HRESULT WINAPI
InternetExplorer_get_Container(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
214 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
215 FIXME("(%p)->(%p)\n", This
, ppDisp
);
219 static HRESULT WINAPI
InternetExplorer_get_Document(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
221 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
222 FIXME("(%p)->(%p)\n", This
, ppDisp
);
226 static HRESULT WINAPI
InternetExplorer_get_TopLevelContainer(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
228 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
229 FIXME("(%p)->(%p)\n", This
, pBool
);
233 static HRESULT WINAPI
InternetExplorer_get_Type(IWebBrowser2
*iface
, BSTR
*Type
)
235 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
236 FIXME("(%p)->(%p)\n", This
, Type
);
240 static HRESULT WINAPI
InternetExplorer_get_Left(IWebBrowser2
*iface
, LONG
*pl
)
242 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
243 FIXME("(%p)->(%p)\n", This
, pl
);
247 static HRESULT WINAPI
InternetExplorer_put_Left(IWebBrowser2
*iface
, LONG Left
)
249 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
250 FIXME("(%p)->(%d)\n", This
, Left
);
254 static HRESULT WINAPI
InternetExplorer_get_Top(IWebBrowser2
*iface
, LONG
*pl
)
256 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
257 FIXME("(%p)->(%p)\n", This
, pl
);
261 static HRESULT WINAPI
InternetExplorer_put_Top(IWebBrowser2
*iface
, LONG Top
)
263 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
264 FIXME("(%p)->(%d)\n", This
, Top
);
268 static HRESULT WINAPI
InternetExplorer_get_Width(IWebBrowser2
*iface
, LONG
*pl
)
270 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
271 FIXME("(%p)->(%p)\n", This
, pl
);
275 static HRESULT WINAPI
InternetExplorer_put_Width(IWebBrowser2
*iface
, LONG Width
)
277 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
278 FIXME("(%p)->(%d)\n", This
, Width
);
282 static HRESULT WINAPI
InternetExplorer_get_Height(IWebBrowser2
*iface
, LONG
*pl
)
284 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
285 FIXME("(%p)->(%p)\n", This
, pl
);
289 static HRESULT WINAPI
InternetExplorer_put_Height(IWebBrowser2
*iface
, LONG Height
)
291 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
292 FIXME("(%p)->(%d)\n", This
, Height
);
296 static HRESULT WINAPI
InternetExplorer_get_LocationName(IWebBrowser2
*iface
, BSTR
*LocationName
)
298 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
299 FIXME("(%p)->(%p)\n", This
, LocationName
);
303 static HRESULT WINAPI
InternetExplorer_get_LocationURL(IWebBrowser2
*iface
, BSTR
*LocationURL
)
305 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
307 TRACE("(%p)->(%p)\n", This
, LocationURL
);
309 return get_location_url(&This
->doc_host
, LocationURL
);
312 static HRESULT WINAPI
InternetExplorer_get_Busy(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
314 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
315 FIXME("(%p)->(%p)\n", This
, pBool
);
319 static HRESULT WINAPI
InternetExplorer_Quit(IWebBrowser2
*iface
)
321 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
322 FIXME("(%p)\n", This
);
326 static HRESULT WINAPI
InternetExplorer_ClientToWindow(IWebBrowser2
*iface
, int *pcx
, int *pcy
)
328 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
329 FIXME("(%p)->(%p %p)\n", This
, pcx
, pcy
);
333 static HRESULT WINAPI
InternetExplorer_PutProperty(IWebBrowser2
*iface
, BSTR szProperty
, VARIANT vtValue
)
335 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
336 FIXME("(%p)->(%s)\n", This
, debugstr_w(szProperty
));
340 static HRESULT WINAPI
InternetExplorer_GetProperty(IWebBrowser2
*iface
, BSTR szProperty
, VARIANT
*pvtValue
)
342 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
343 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(szProperty
), pvtValue
);
347 static HRESULT WINAPI
InternetExplorer_get_Name(IWebBrowser2
*iface
, BSTR
*Name
)
349 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
350 FIXME("(%p)->(%p)\n", This
, Name
);
354 static HRESULT WINAPI
InternetExplorer_get_HWND(IWebBrowser2
*iface
, SHANDLE_PTR
*pHWND
)
356 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
357 FIXME("(%p)->(%p)\n", This
, pHWND
);
361 static HRESULT WINAPI
InternetExplorer_get_FullName(IWebBrowser2
*iface
, BSTR
*FullName
)
363 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
364 FIXME("(%p)->(%p)\n", This
, FullName
);
368 static HRESULT WINAPI
InternetExplorer_get_Path(IWebBrowser2
*iface
, BSTR
*Path
)
370 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
371 FIXME("(%p)->(%p)\n", This
, Path
);
375 static HRESULT WINAPI
InternetExplorer_get_Visible(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
377 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
379 TRACE("(%p)->(%p)\n", This
, pBool
);
381 *pBool
= IsWindowVisible(This
->frame_hwnd
) ? VARIANT_TRUE
: VARIANT_FALSE
;
385 static HRESULT WINAPI
InternetExplorer_put_Visible(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
387 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
388 TRACE("(%p)->(%x)\n", This
, Value
);
390 ShowWindow(This
->frame_hwnd
, Value
? SW_SHOW
: SW_HIDE
);
395 static HRESULT WINAPI
InternetExplorer_get_StatusBar(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
397 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
398 FIXME("(%p)->(%p)\n", This
, pBool
);
402 static HRESULT WINAPI
InternetExplorer_put_StatusBar(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
404 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
405 FIXME("(%p)->(%x)\n", This
, Value
);
409 static HRESULT WINAPI
InternetExplorer_get_StatusText(IWebBrowser2
*iface
, BSTR
*StatusText
)
411 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
412 FIXME("(%p)->(%p)\n", This
, StatusText
);
416 static HRESULT WINAPI
InternetExplorer_put_StatusText(IWebBrowser2
*iface
, BSTR StatusText
)
418 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
420 TRACE("(%p)->(%s)\n", This
, debugstr_w(StatusText
));
422 return update_ie_statustext(This
, StatusText
);
425 static HRESULT WINAPI
InternetExplorer_get_ToolBar(IWebBrowser2
*iface
, int *Value
)
427 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
428 FIXME("(%p)->(%p)\n", This
, Value
);
432 static HRESULT WINAPI
InternetExplorer_put_ToolBar(IWebBrowser2
*iface
, int Value
)
434 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
435 FIXME("(%p)->(%d)\n", This
, Value
);
439 static HRESULT WINAPI
InternetExplorer_get_MenuBar(IWebBrowser2
*iface
, VARIANT_BOOL
*Value
)
441 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
442 FIXME("(%p)->(%p)\n", This
, Value
);
446 static HRESULT WINAPI
InternetExplorer_put_MenuBar(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
448 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
451 TRACE("(%p)->(%x)\n", This
, Value
);
456 if(!SetMenu(This
->frame_hwnd
, menu
))
457 return HRESULT_FROM_WIN32(GetLastError());
462 static HRESULT WINAPI
InternetExplorer_get_FullScreen(IWebBrowser2
*iface
, VARIANT_BOOL
*pbFullScreen
)
464 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
465 FIXME("(%p)->(%p)\n", This
, pbFullScreen
);
469 static HRESULT WINAPI
InternetExplorer_put_FullScreen(IWebBrowser2
*iface
, VARIANT_BOOL bFullScreen
)
471 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
472 FIXME("(%p)->(%x)\n", This
, bFullScreen
);
476 static HRESULT WINAPI
InternetExplorer_Navigate2(IWebBrowser2
*iface
, VARIANT
*URL
, VARIANT
*Flags
,
477 VARIANT
*TargetFrameName
, VARIANT
*PostData
, VARIANT
*Headers
)
479 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
481 TRACE("(%p)->(%p %p %p %p %p)\n", This
, URL
, Flags
, TargetFrameName
, PostData
, Headers
);
486 if(V_VT(URL
) != VT_BSTR
) {
487 FIXME("Unsupported V_VT(URL) %d\n", V_VT(URL
));
491 return navigate_url(&This
->doc_host
, V_BSTR(URL
), Flags
, TargetFrameName
, PostData
, Headers
);
494 static HRESULT WINAPI
InternetExplorer_QueryStatusWB(IWebBrowser2
*iface
, OLECMDID cmdID
, OLECMDF
*pcmdf
)
496 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
497 FIXME("(%p)->(%d %p)\n", This
, cmdID
, pcmdf
);
501 static HRESULT WINAPI
InternetExplorer_ExecWB(IWebBrowser2
*iface
, OLECMDID cmdID
,
502 OLECMDEXECOPT cmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
)
504 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
505 FIXME("(%p)->(%d %d %p %p)\n", This
, cmdID
, cmdexecopt
, pvaIn
, pvaOut
);
509 static HRESULT WINAPI
InternetExplorer_ShowBrowserBar(IWebBrowser2
*iface
, VARIANT
*pvaClsid
,
510 VARIANT
*pvarShow
, VARIANT
*pvarSize
)
512 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
513 FIXME("(%p)->(%p %p %p)\n", This
, pvaClsid
, pvarShow
, pvarSize
);
517 static HRESULT WINAPI
InternetExplorer_get_ReadyState(IWebBrowser2
*iface
, READYSTATE
*lpReadyState
)
519 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
520 FIXME("(%p)->(%p)\n", This
, lpReadyState
);
524 static HRESULT WINAPI
InternetExplorer_get_Offline(IWebBrowser2
*iface
, VARIANT_BOOL
*pbOffline
)
526 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
527 FIXME("(%p)->(%p)\n", This
, pbOffline
);
531 static HRESULT WINAPI
InternetExplorer_put_Offline(IWebBrowser2
*iface
, VARIANT_BOOL bOffline
)
533 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
534 FIXME("(%p)->(%x)\n", This
, bOffline
);
538 static HRESULT WINAPI
InternetExplorer_get_Silent(IWebBrowser2
*iface
, VARIANT_BOOL
*pbSilent
)
540 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
541 FIXME("(%p)->(%p)\n", This
, pbSilent
);
545 static HRESULT WINAPI
InternetExplorer_put_Silent(IWebBrowser2
*iface
, VARIANT_BOOL bSilent
)
547 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
548 FIXME("(%p)->(%x)\n", This
, bSilent
);
552 static HRESULT WINAPI
InternetExplorer_get_RegisterAsBrowser(IWebBrowser2
*iface
,
553 VARIANT_BOOL
*pbRegister
)
555 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
556 FIXME("(%p)->(%p)\n", This
, pbRegister
);
560 static HRESULT WINAPI
InternetExplorer_put_RegisterAsBrowser(IWebBrowser2
*iface
,
561 VARIANT_BOOL bRegister
)
563 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
564 FIXME("(%p)->(%x)\n", This
, bRegister
);
568 static HRESULT WINAPI
InternetExplorer_get_RegisterAsDropTarget(IWebBrowser2
*iface
,
569 VARIANT_BOOL
*pbRegister
)
571 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
572 FIXME("(%p)->(%p)\n", This
, pbRegister
);
576 static HRESULT WINAPI
InternetExplorer_put_RegisterAsDropTarget(IWebBrowser2
*iface
,
577 VARIANT_BOOL bRegister
)
579 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
580 FIXME("(%p)->(%x)\n", This
, bRegister
);
584 static HRESULT WINAPI
InternetExplorer_get_TheaterMode(IWebBrowser2
*iface
, VARIANT_BOOL
*pbRegister
)
586 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
587 FIXME("(%p)->(%p)\n", This
, pbRegister
);
591 static HRESULT WINAPI
InternetExplorer_put_TheaterMode(IWebBrowser2
*iface
, VARIANT_BOOL bRegister
)
593 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
594 FIXME("(%p)->(%x)\n", This
, bRegister
);
598 static HRESULT WINAPI
InternetExplorer_get_AddressBar(IWebBrowser2
*iface
, VARIANT_BOOL
*Value
)
600 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
601 FIXME("(%p)->(%p)\n", This
, Value
);
605 static HRESULT WINAPI
InternetExplorer_put_AddressBar(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
607 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
608 FIXME("(%p)->(%x)\n", This
, Value
);
612 static HRESULT WINAPI
InternetExplorer_get_Resizable(IWebBrowser2
*iface
, VARIANT_BOOL
*Value
)
614 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
615 FIXME("(%p)->(%p)\n", This
, Value
);
619 static HRESULT WINAPI
InternetExplorer_put_Resizable(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
621 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
622 FIXME("(%p)->(%x)\n", This
, Value
);
626 static const IWebBrowser2Vtbl InternetExplorerVtbl
=
628 InternetExplorer_QueryInterface
,
629 InternetExplorer_AddRef
,
630 InternetExplorer_Release
,
631 InternetExplorer_GetTypeInfoCount
,
632 InternetExplorer_GetTypeInfo
,
633 InternetExplorer_GetIDsOfNames
,
634 InternetExplorer_Invoke
,
635 InternetExplorer_GoBack
,
636 InternetExplorer_GoForward
,
637 InternetExplorer_GoHome
,
638 InternetExplorer_GoSearch
,
639 InternetExplorer_Navigate
,
640 InternetExplorer_Refresh
,
641 InternetExplorer_Refresh2
,
642 InternetExplorer_Stop
,
643 InternetExplorer_get_Application
,
644 InternetExplorer_get_Parent
,
645 InternetExplorer_get_Container
,
646 InternetExplorer_get_Document
,
647 InternetExplorer_get_TopLevelContainer
,
648 InternetExplorer_get_Type
,
649 InternetExplorer_get_Left
,
650 InternetExplorer_put_Left
,
651 InternetExplorer_get_Top
,
652 InternetExplorer_put_Top
,
653 InternetExplorer_get_Width
,
654 InternetExplorer_put_Width
,
655 InternetExplorer_get_Height
,
656 InternetExplorer_put_Height
,
657 InternetExplorer_get_LocationName
,
658 InternetExplorer_get_LocationURL
,
659 InternetExplorer_get_Busy
,
660 InternetExplorer_Quit
,
661 InternetExplorer_ClientToWindow
,
662 InternetExplorer_PutProperty
,
663 InternetExplorer_GetProperty
,
664 InternetExplorer_get_Name
,
665 InternetExplorer_get_HWND
,
666 InternetExplorer_get_FullName
,
667 InternetExplorer_get_Path
,
668 InternetExplorer_get_Visible
,
669 InternetExplorer_put_Visible
,
670 InternetExplorer_get_StatusBar
,
671 InternetExplorer_put_StatusBar
,
672 InternetExplorer_get_StatusText
,
673 InternetExplorer_put_StatusText
,
674 InternetExplorer_get_ToolBar
,
675 InternetExplorer_put_ToolBar
,
676 InternetExplorer_get_MenuBar
,
677 InternetExplorer_put_MenuBar
,
678 InternetExplorer_get_FullScreen
,
679 InternetExplorer_put_FullScreen
,
680 InternetExplorer_Navigate2
,
681 InternetExplorer_QueryStatusWB
,
682 InternetExplorer_ExecWB
,
683 InternetExplorer_ShowBrowserBar
,
684 InternetExplorer_get_ReadyState
,
685 InternetExplorer_get_Offline
,
686 InternetExplorer_put_Offline
,
687 InternetExplorer_get_Silent
,
688 InternetExplorer_put_Silent
,
689 InternetExplorer_get_RegisterAsBrowser
,
690 InternetExplorer_put_RegisterAsBrowser
,
691 InternetExplorer_get_RegisterAsDropTarget
,
692 InternetExplorer_put_RegisterAsDropTarget
,
693 InternetExplorer_get_TheaterMode
,
694 InternetExplorer_put_TheaterMode
,
695 InternetExplorer_get_AddressBar
,
696 InternetExplorer_put_AddressBar
,
697 InternetExplorer_get_Resizable
,
698 InternetExplorer_put_Resizable
701 static inline InternetExplorer
*impl_from_IExternalConnection(IExternalConnection
*iface
)
703 return CONTAINING_RECORD(iface
, InternetExplorer
, IExternalConnection_iface
);
707 * Document may keep references to InternetExplorer object causing circular references.
708 * We keep track of external references and release the document object when all
709 * external references are released. A visible main window is also considered as
710 * an external reference.
712 DWORD
release_extern_ref(InternetExplorer
*This
, BOOL last_closes
)
714 LONG ref
= InterlockedDecrement(&This
->extern_ref
);
716 TRACE("ref = %d\n", ref
);
722 WARN("Last external connection released with FALSE last_closes.\n");
726 deactivate_document(&This
->doc_host
);
730 static HRESULT WINAPI
ExternalConnection_QueryInterface(IExternalConnection
*iface
, REFIID riid
, void **ppv
)
732 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
733 return IWebBrowser2_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppv
);
736 static ULONG WINAPI
ExternalConnection_AddRef(IExternalConnection
*iface
)
738 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
739 return IWebBrowser2_AddRef(&This
->IWebBrowser2_iface
);
742 static ULONG WINAPI
ExternalConnection_Release(IExternalConnection
*iface
)
744 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
745 return IWebBrowser2_Release(&This
->IWebBrowser2_iface
);
748 static DWORD WINAPI
ExternalConnection_AddConnection(IExternalConnection
*iface
, DWORD extconn
, DWORD reserved
)
750 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
752 TRACE("(%p)->(%x %x)\n", This
, extconn
, reserved
);
754 if(extconn
!= EXTCONN_STRONG
)
757 return InterlockedIncrement(&This
->extern_ref
);
760 static DWORD WINAPI
ExternalConnection_ReleaseConnection(IExternalConnection
*iface
, DWORD extconn
,
761 DWORD reserved
, BOOL fLastReleaseCloses
)
763 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
765 TRACE("(%p)->(%x %x %x)\n", This
, extconn
, reserved
, fLastReleaseCloses
);
767 if(extconn
!= EXTCONN_STRONG
)
770 return release_extern_ref(This
, fLastReleaseCloses
);
773 static const IExternalConnectionVtbl ExternalConnectionVtbl
= {
774 ExternalConnection_QueryInterface
,
775 ExternalConnection_AddRef
,
776 ExternalConnection_Release
,
777 ExternalConnection_AddConnection
,
778 ExternalConnection_ReleaseConnection
781 static inline InternetExplorer
*impl_from_IServiceProvider(IServiceProvider
*iface
)
783 return CONTAINING_RECORD(iface
, InternetExplorer
, IServiceProvider_iface
);
786 static HRESULT WINAPI
IEServiceProvider_QueryInterface(IServiceProvider
*iface
,
787 REFIID riid
, LPVOID
*ppv
)
789 InternetExplorer
*This
= impl_from_IServiceProvider(iface
);
790 return IWebBrowser2_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppv
);
793 static ULONG WINAPI
IEServiceProvider_AddRef(IServiceProvider
*iface
)
795 InternetExplorer
*This
= impl_from_IServiceProvider(iface
);
796 return IWebBrowser2_AddRef(&This
->IWebBrowser2_iface
);
799 static ULONG WINAPI
IEServiceProvider_Release(IServiceProvider
*iface
)
801 InternetExplorer
*This
= impl_from_IServiceProvider(iface
);
802 return IWebBrowser2_Release(&This
->IWebBrowser2_iface
);
805 static HRESULT WINAPI
IEServiceProvider_QueryService(IServiceProvider
*iface
,
806 REFGUID guidService
, REFIID riid
, void **ppv
)
808 InternetExplorer
*This
= impl_from_IServiceProvider(iface
);
810 if(IsEqualGUID(&SID_SHTMLWindow
, riid
)) {
811 TRACE("(%p)->(SID_SHTMLWindow)\n", This
);
812 return IHTMLWindow2_QueryInterface(&This
->doc_host
.html_window
.IHTMLWindow2_iface
, riid
, ppv
);
815 FIXME("(%p)->(%s, %s %p)\n", This
, debugstr_guid(guidService
), debugstr_guid(riid
), ppv
);
817 return E_NOINTERFACE
;
820 static const IServiceProviderVtbl ServiceProviderVtbl
=
822 IEServiceProvider_QueryInterface
,
823 IEServiceProvider_AddRef
,
824 IEServiceProvider_Release
,
825 IEServiceProvider_QueryService
828 void InternetExplorer_WebBrowser_Init(InternetExplorer
*This
)
830 This
->IWebBrowser2_iface
.lpVtbl
= &InternetExplorerVtbl
;
831 This
->IExternalConnection_iface
.lpVtbl
= &ExternalConnectionVtbl
;
832 This
->IServiceProvider_iface
.lpVtbl
= &ServiceProviderVtbl
;