2 * WebBrowser Implementation
4 * Copyright 2005 James Hawkins
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
23 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp
);
27 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
29 typedef struct IOleClientSiteImpl
31 const IOleClientSiteVtbl
*lpVtbl
;
32 const IOleInPlaceSiteVtbl
*lpvtblOleInPlaceSite
;
33 const IOleInPlaceFrameVtbl
*lpvtblOleInPlaceFrame
;
34 const IDocHostUIHandlerVtbl
*lpvtblDocHostUIHandler
;
36 /* IOleClientSiteImpl data */
37 IOleObject
*pBrowserObject
;
40 /* IOleInPlaceFrame data */
44 #define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpVtbl)
45 #define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpvtblDocHostUIHandler)
46 #define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpvtblOleInPlaceSite)
47 #define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpvtblOleInPlaceFrame)
49 static HRESULT STDMETHODCALLTYPE
Site_QueryInterface(IOleClientSite
*iface
, REFIID riid
, void **ppvObj
)
51 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpVtbl
, iface
);
55 if (IsEqualIID(riid
, &IID_IUnknown
)) {
56 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppvObj
);
57 *ppvObj
= CLIENTSITE(This
);
58 }else if(IsEqualIID(riid
, &IID_IOleClientSite
)) {
59 TRACE("(%p)->(IID_IOleClientSite %p)\n", This
, ppvObj
);
60 *ppvObj
= CLIENTSITE(This
);
61 }else if (IsEqualIID(riid
, &IID_IOleInPlaceSite
)) {
62 TRACE("(%p)->(IID_IOleInPlaceSite %p)\n", This
, ppvObj
);
63 *ppvObj
= &(This
->lpvtblOleInPlaceSite
);
64 }else if (IsEqualIID(riid
, &IID_IOleInPlaceFrame
)) {
65 TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This
, ppvObj
);
66 *ppvObj
= &(This
->lpvtblOleInPlaceSite
);
67 }else if (IsEqualIID(riid
, &IID_IDocHostUIHandler
)) {
68 TRACE("(%p)->(IID_IDocHostUIHandler %p)\n", This
, ppvObj
);
69 *ppvObj
= &(This
->lpvtblDocHostUIHandler
);
71 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppvObj
);
75 IUnknown_AddRef((IUnknown
*)*ppvObj
);
79 static ULONG STDMETHODCALLTYPE
Site_AddRef(IOleClientSite
*iface
)
81 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpVtbl
, iface
);
82 LONG ref
= InterlockedIncrement(&This
->ref
);
84 TRACE("(%p) ref=%d\n", This
, ref
);
89 static ULONG STDMETHODCALLTYPE
Site_Release(IOleClientSite
*iface
)
91 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpVtbl
, iface
);
92 LONG ref
= InterlockedDecrement(&This
->ref
);
94 TRACE("(%p) ref=%d\n", This
, ref
);
102 static HRESULT STDMETHODCALLTYPE
Site_SaveObject(IOleClientSite
*iface
)
107 static HRESULT STDMETHODCALLTYPE
Site_GetMoniker(IOleClientSite
*iface
, DWORD dwAssign
, DWORD dwWhichMoniker
, IMoniker
**ppmk
)
112 static HRESULT STDMETHODCALLTYPE
Site_GetContainer(IOleClientSite
*iface
, LPOLECONTAINER
*ppContainer
)
116 return E_NOINTERFACE
;
119 static HRESULT STDMETHODCALLTYPE
Site_ShowObject(IOleClientSite
*iface
)
124 static HRESULT STDMETHODCALLTYPE
Site_OnShowWindow(IOleClientSite
*iface
, BOOL fShow
)
129 static HRESULT STDMETHODCALLTYPE
Site_RequestNewObjectLayout(IOleClientSite
*iface
)
134 static const IOleClientSiteVtbl MyIOleClientSiteTable
=
144 Site_RequestNewObjectLayout
147 static HRESULT STDMETHODCALLTYPE
UI_QueryInterface(IDocHostUIHandler
*iface
, REFIID riid
, LPVOID
*ppvObj
)
149 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblDocHostUIHandler
, iface
);
151 return IOleClientSite_QueryInterface(CLIENTSITE(This
), riid
, ppvObj
);
154 static ULONG STDMETHODCALLTYPE
UI_AddRef(IDocHostUIHandler
*iface
)
156 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblDocHostUIHandler
, iface
);
158 return IOleClientSite_AddRef(CLIENTSITE(This
));
161 static ULONG STDMETHODCALLTYPE
UI_Release(IDocHostUIHandler
* iface
)
163 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblDocHostUIHandler
, iface
);
165 return IOleClientSite_Release(CLIENTSITE(This
));
168 static HRESULT STDMETHODCALLTYPE
UI_ShowContextMenu(IDocHostUIHandler
*iface
, DWORD dwID
, POINT
*ppt
, IUnknown
*pcmdtReserved
, IDispatch
*pdispReserved
)
173 static HRESULT STDMETHODCALLTYPE
UI_GetHostInfo(IDocHostUIHandler
*iface
, DOCHOSTUIINFO
*pInfo
)
175 pInfo
->cbSize
= sizeof(DOCHOSTUIINFO
);
176 pInfo
->dwFlags
= DOCHOSTUIFLAG_NO3DBORDER
;
177 pInfo
->dwDoubleClick
= DOCHOSTUIDBLCLK_DEFAULT
;
182 static HRESULT STDMETHODCALLTYPE
UI_ShowUI(IDocHostUIHandler
*iface
, DWORD dwID
, IOleInPlaceActiveObject
*pActiveObject
, IOleCommandTarget
*pCommandTarget
, IOleInPlaceFrame
*pFrame
, IOleInPlaceUIWindow
*pDoc
)
187 static HRESULT STDMETHODCALLTYPE
UI_HideUI(IDocHostUIHandler
*iface
)
192 static HRESULT STDMETHODCALLTYPE
UI_UpdateUI(IDocHostUIHandler
*iface
)
197 static HRESULT STDMETHODCALLTYPE
UI_EnableModeless(IDocHostUIHandler
*iface
, BOOL fEnable
)
202 static HRESULT STDMETHODCALLTYPE
UI_OnDocWindowActivate(IDocHostUIHandler
*iface
, BOOL fActivate
)
207 static HRESULT STDMETHODCALLTYPE
UI_OnFrameWindowActivate(IDocHostUIHandler
*iface
, BOOL fActivate
)
212 static HRESULT STDMETHODCALLTYPE
UI_ResizeBorder(IDocHostUIHandler
*iface
, LPCRECT prcBorder
, IOleInPlaceUIWindow
*pUIWindow
, BOOL fRameWindow
)
217 static HRESULT STDMETHODCALLTYPE
UI_TranslateAccelerator(IDocHostUIHandler
*iface
, LPMSG lpMsg
, const GUID
*pguidCmdGroup
, DWORD nCmdID
)
222 static HRESULT STDMETHODCALLTYPE
UI_GetOptionKeyPath(IDocHostUIHandler
*iface
, LPOLESTR
*pchKey
, DWORD dw
)
227 static HRESULT STDMETHODCALLTYPE
UI_GetDropTarget(IDocHostUIHandler
*iface
, IDropTarget
*pDropTarget
, IDropTarget
**ppDropTarget
)
232 static HRESULT STDMETHODCALLTYPE
UI_GetExternal(IDocHostUIHandler
*iface
, IDispatch
**ppDispatch
)
238 static HRESULT STDMETHODCALLTYPE
UI_TranslateUrl(IDocHostUIHandler
*iface
, DWORD dwTranslate
, OLECHAR
*pchURLIn
, OLECHAR
**ppchURLOut
)
244 static HRESULT STDMETHODCALLTYPE
UI_FilterDataObject(IDocHostUIHandler
*iface
, IDataObject
*pDO
, IDataObject
**ppDORet
)
250 static const IDocHostUIHandlerVtbl MyIDocHostUIHandlerTable
=
261 UI_OnDocWindowActivate
,
262 UI_OnFrameWindowActivate
,
264 UI_TranslateAccelerator
,
272 static HRESULT STDMETHODCALLTYPE
InPlace_QueryInterface(IOleInPlaceSite
*iface
, REFIID riid
, LPVOID
*ppvObj
)
274 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceSite
, iface
);
276 return IOleClientSite_QueryInterface(CLIENTSITE(This
), riid
, ppvObj
);
279 static ULONG STDMETHODCALLTYPE
InPlace_AddRef(IOleInPlaceSite
*iface
)
281 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceSite
, iface
);
283 return IOleClientSite_AddRef(CLIENTSITE(This
));
286 static ULONG STDMETHODCALLTYPE
InPlace_Release(IOleInPlaceSite
*iface
)
288 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceSite
, iface
);
290 return IOleClientSite_Release(CLIENTSITE(This
));
293 static HRESULT STDMETHODCALLTYPE
InPlace_GetWindow(IOleInPlaceSite
*iface
, HWND
*lphwnd
)
295 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceSite
, iface
);
296 *lphwnd
= This
->hwndWindow
;
301 static HRESULT STDMETHODCALLTYPE
InPlace_ContextSensitiveHelp(IOleInPlaceSite
*iface
, BOOL fEnterMode
)
306 static HRESULT STDMETHODCALLTYPE
InPlace_CanInPlaceActivate(IOleInPlaceSite
*iface
)
311 static HRESULT STDMETHODCALLTYPE
InPlace_OnInPlaceActivate(IOleInPlaceSite
*iface
)
316 static HRESULT STDMETHODCALLTYPE
InPlace_OnUIActivate(IOleInPlaceSite
*iface
)
321 static HRESULT STDMETHODCALLTYPE
InPlace_GetWindowContext(IOleInPlaceSite
*iface
, LPOLEINPLACEFRAME
*lplpFrame
, LPOLEINPLACEUIWINDOW
*lplpDoc
, LPRECT lprcPosRect
, LPRECT lprcClipRect
, LPOLEINPLACEFRAMEINFO lpFrameInfo
)
323 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceSite
, iface
);
325 *lplpFrame
= INPLACEFRAME(This
);
326 IOleInPlaceFrame_AddRef(INPLACEFRAME(This
));
330 lpFrameInfo
->fMDIApp
= FALSE
;
331 lpFrameInfo
->hwndFrame
= This
->hwndWindow
;
332 lpFrameInfo
->haccel
= NULL
;
333 lpFrameInfo
->cAccelEntries
= 0;
338 static HRESULT STDMETHODCALLTYPE
InPlace_Scroll(IOleInPlaceSite
*iface
, SIZE scrollExtent
)
343 static HRESULT STDMETHODCALLTYPE
InPlace_OnUIDeactivate(IOleInPlaceSite
*iface
, BOOL fUndoable
)
348 static HRESULT STDMETHODCALLTYPE
InPlace_OnInPlaceDeactivate(IOleInPlaceSite
*iface
)
353 static HRESULT STDMETHODCALLTYPE
InPlace_DiscardUndoState(IOleInPlaceSite
*iface
)
358 static HRESULT STDMETHODCALLTYPE
InPlace_DeactivateAndUndo(IOleInPlaceSite
*iface
)
363 static HRESULT STDMETHODCALLTYPE
InPlace_OnPosRectChange(IOleInPlaceSite
*iface
, LPCRECT lprcPosRect
)
365 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceSite
, iface
);
366 IOleInPlaceObject
*inplace
;
368 if (IOleObject_QueryInterface(This
->pBrowserObject
, &IID_IOleInPlaceObject
,
369 (void **)&inplace
) == S_OK
)
371 IOleInPlaceObject_SetObjectRects(inplace
, lprcPosRect
, lprcPosRect
);
372 IOleInPlaceObject_Release(inplace
);
378 static const IOleInPlaceSiteVtbl MyIOleInPlaceSiteTable
=
380 InPlace_QueryInterface
,
384 InPlace_ContextSensitiveHelp
,
385 InPlace_CanInPlaceActivate
,
386 InPlace_OnInPlaceActivate
,
387 InPlace_OnUIActivate
,
388 InPlace_GetWindowContext
,
390 InPlace_OnUIDeactivate
,
391 InPlace_OnInPlaceDeactivate
,
392 InPlace_DiscardUndoState
,
393 InPlace_DeactivateAndUndo
,
394 InPlace_OnPosRectChange
397 static HRESULT STDMETHODCALLTYPE
Frame_QueryInterface(IOleInPlaceFrame
*iface
, REFIID riid
, LPVOID
*ppvObj
)
399 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceFrame
, iface
);
401 return IOleClientSite_QueryInterface(CLIENTSITE(This
), riid
, ppvObj
);
404 static ULONG STDMETHODCALLTYPE
Frame_AddRef(IOleInPlaceFrame
*iface
)
406 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceFrame
, iface
);
408 return IOleClientSite_AddRef(CLIENTSITE(This
));
411 static ULONG STDMETHODCALLTYPE
Frame_Release(IOleInPlaceFrame
*iface
)
413 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceFrame
, iface
);
415 return IOleClientSite_Release(CLIENTSITE(This
));
418 static HRESULT STDMETHODCALLTYPE
Frame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*lphwnd
)
420 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceFrame
, iface
);
421 *lphwnd
= This
->hwndWindow
;
426 static HRESULT STDMETHODCALLTYPE
Frame_ContextSensitiveHelp(IOleInPlaceFrame
*iface
, BOOL fEnterMode
)
431 static HRESULT STDMETHODCALLTYPE
Frame_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
436 static HRESULT STDMETHODCALLTYPE
Frame_RequestBorderSpace(IOleInPlaceFrame
*iface
, LPCBORDERWIDTHS pborderwidths
)
441 static HRESULT STDMETHODCALLTYPE
Frame_SetBorderSpace(IOleInPlaceFrame
*iface
, LPCBORDERWIDTHS pborderwidths
)
446 static HRESULT STDMETHODCALLTYPE
Frame_SetActiveObject(IOleInPlaceFrame
*iface
, IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
451 static HRESULT STDMETHODCALLTYPE
Frame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
, LPOLEMENUGROUPWIDTHS lpMenuWidths
)
456 static HRESULT STDMETHODCALLTYPE
Frame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
, HOLEMENU holemenu
, HWND hwndActiveObject
)
461 static HRESULT STDMETHODCALLTYPE
Frame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
466 static HRESULT STDMETHODCALLTYPE
Frame_SetStatusText(IOleInPlaceFrame
*iface
, LPCOLESTR pszStatusText
)
471 static HRESULT STDMETHODCALLTYPE
Frame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
476 static HRESULT STDMETHODCALLTYPE
Frame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
, WORD wID
)
481 static const IOleInPlaceFrameVtbl MyIOleInPlaceFrameTable
=
483 Frame_QueryInterface
,
487 Frame_ContextSensitiveHelp
,
489 Frame_RequestBorderSpace
,
490 Frame_SetBorderSpace
,
491 Frame_SetActiveObject
,
496 Frame_EnableModeless
,
497 Frame_TranslateAccelerator
500 static HRESULT STDMETHODCALLTYPE
Storage_QueryInterface(IStorage
*This
, REFIID riid
, LPVOID
*ppvObj
)
505 static ULONG STDMETHODCALLTYPE
Storage_AddRef(IStorage
*This
)
510 static ULONG STDMETHODCALLTYPE
Storage_Release(IStorage
*This
)
515 static HRESULT STDMETHODCALLTYPE
Storage_CreateStream(IStorage
*This
, const WCHAR
*pwcsName
, DWORD grfMode
, DWORD reserved1
, DWORD reserved2
, IStream
**ppstm
)
520 static HRESULT STDMETHODCALLTYPE
Storage_OpenStream(IStorage
*This
, const WCHAR
* pwcsName
, void *reserved1
, DWORD grfMode
, DWORD reserved2
, IStream
**ppstm
)
525 static HRESULT STDMETHODCALLTYPE
Storage_CreateStorage(IStorage
*This
, const WCHAR
*pwcsName
, DWORD grfMode
, DWORD reserved1
, DWORD reserved2
, IStorage
**ppstg
)
530 static HRESULT STDMETHODCALLTYPE
Storage_OpenStorage(IStorage
*This
, const WCHAR
* pwcsName
, IStorage
* pstgPriority
, DWORD grfMode
, SNB snbExclude
, DWORD reserved
, IStorage
**ppstg
)
535 static HRESULT STDMETHODCALLTYPE
Storage_CopyTo(IStorage
*This
, DWORD ciidExclude
, IID
const *rgiidExclude
, SNB snbExclude
,IStorage
*pstgDest
)
540 static HRESULT STDMETHODCALLTYPE
Storage_MoveElementTo(IStorage
*This
, const OLECHAR
*pwcsName
,IStorage
* pstgDest
, const OLECHAR
*pwcsNewName
, DWORD grfFlags
)
545 static HRESULT STDMETHODCALLTYPE
Storage_Commit(IStorage
*This
, DWORD grfCommitFlags
)
550 static HRESULT STDMETHODCALLTYPE
Storage_Revert(IStorage
*This
)
555 static HRESULT STDMETHODCALLTYPE
Storage_EnumElements(IStorage
*This
, DWORD reserved1
, void *reserved2
, DWORD reserved3
, IEnumSTATSTG
**ppenum
)
560 static HRESULT STDMETHODCALLTYPE
Storage_DestroyElement(IStorage
*This
, const OLECHAR
*pwcsName
)
565 static HRESULT STDMETHODCALLTYPE
Storage_RenameElement(IStorage
*This
, const WCHAR
*pwcsOldName
, const WCHAR
*pwcsNewName
)
570 static HRESULT STDMETHODCALLTYPE
Storage_SetElementTimes(IStorage
*This
, const WCHAR
*pwcsName
, FILETIME
const *pctime
, FILETIME
const *patime
, FILETIME
const *pmtime
)
575 static HRESULT STDMETHODCALLTYPE
Storage_SetClass(IStorage
*This
, REFCLSID clsid
)
580 static HRESULT STDMETHODCALLTYPE
Storage_SetStateBits(IStorage
*This
, DWORD grfStateBits
, DWORD grfMask
)
585 static HRESULT STDMETHODCALLTYPE
Storage_Stat(IStorage
*This
, STATSTG
*pstatstg
, DWORD grfStatFlag
)
590 static const IStorageVtbl MyIStorageTable
=
592 Storage_QueryInterface
,
595 Storage_CreateStream
,
597 Storage_CreateStorage
,
600 Storage_MoveElementTo
,
603 Storage_EnumElements
,
604 Storage_DestroyElement
,
605 Storage_RenameElement
,
606 Storage_SetElementTimes
,
608 Storage_SetStateBits
,
612 static IStorage MyIStorage
= { &MyIStorageTable
};
614 BOOL
InitWebBrowser(HHInfo
*info
, HWND hwndParent
)
616 IOleClientSiteImpl
*iOleClientSiteImpl
;
617 IOleInPlaceObject
*inplace
;
618 IOleObject
*browserObject
;
619 IWebBrowser2
*webBrowser2
;
623 iOleClientSiteImpl
= heap_alloc_zero(sizeof(IOleClientSiteImpl
));
624 if (!iOleClientSiteImpl
)
627 iOleClientSiteImpl
->ref
= 1;
628 iOleClientSiteImpl
->lpVtbl
= &MyIOleClientSiteTable
;
629 iOleClientSiteImpl
->lpvtblOleInPlaceSite
= &MyIOleInPlaceSiteTable
;
630 iOleClientSiteImpl
->lpvtblOleInPlaceFrame
= &MyIOleInPlaceFrameTable
;
631 iOleClientSiteImpl
->hwndWindow
= hwndParent
;
632 iOleClientSiteImpl
->lpvtblDocHostUIHandler
= &MyIDocHostUIHandlerTable
;
634 hr
= OleCreate(&CLSID_WebBrowser
, &IID_IOleObject
, OLERENDER_DRAW
, 0,
635 (IOleClientSite
*)iOleClientSiteImpl
, &MyIStorage
,
636 (void **)&browserObject
);
638 info
->client_site
= (IOleClientSite
*)iOleClientSiteImpl
;
639 info
->wb_object
= browserObject
;
641 if (FAILED(hr
)) goto error
;
643 /* make the browser object accessible to the IOleClientSite implementation */
644 iOleClientSiteImpl
->pBrowserObject
= browserObject
;
646 GetClientRect(hwndParent
, &rc
);
648 hr
= OleSetContainedObject((struct IUnknown
*)browserObject
, TRUE
);
649 if (FAILED(hr
)) goto error
;
651 hr
= IOleObject_DoVerb(browserObject
, OLEIVERB_SHOW
, NULL
,
652 (IOleClientSite
*)iOleClientSiteImpl
,
653 -1, hwndParent
, &rc
);
654 if (FAILED(hr
)) goto error
;
656 hr
= IOleObject_QueryInterface(browserObject
, &IID_IOleInPlaceObject
, (void**)&inplace
);
657 if (FAILED(hr
)) goto error
;
659 IOleInPlaceObject_SetObjectRects(inplace
, &rc
, &rc
);
660 IOleInPlaceObject_Release(inplace
);
662 hr
= IOleObject_QueryInterface(browserObject
, &IID_IWebBrowser2
,
663 (void **)&webBrowser2
);
666 info
->web_browser
= webBrowser2
;
671 ReleaseWebBrowser(info
);
672 heap_free(iOleClientSiteImpl
);
677 void ReleaseWebBrowser(HHInfo
*info
)
681 if (info
->web_browser
)
683 IWebBrowser2_Release(info
->web_browser
);
684 info
->web_browser
= NULL
;
687 if (info
->client_site
)
689 IOleClientSite_Release(info
->client_site
);
690 info
->client_site
= NULL
;
693 if(info
->wb_object
) {
694 IOleInPlaceSite
*inplace
;
696 hres
= IOleObject_QueryInterface(info
->wb_object
, &IID_IOleInPlaceSite
, (void**)&inplace
);
697 if(SUCCEEDED(hres
)) {
698 IOleInPlaceSite_OnInPlaceDeactivate(inplace
);
699 IOleInPlaceSite_Release(inplace
);
702 IOleObject_SetClientSite(info
->wb_object
, NULL
);
704 IOleObject_Release(info
->wb_object
);
705 info
->wb_object
= NULL
;
709 void ResizeWebBrowser(HHInfo
*info
, DWORD dwWidth
, DWORD dwHeight
)
711 if (!info
->web_browser
)
714 IWebBrowser2_put_Width(info
->web_browser
, dwWidth
);
715 IWebBrowser2_put_Height(info
->web_browser
, dwHeight
);
718 void DoPageAction(HHInfo
*info
, DWORD dwAction
)
720 IWebBrowser2
*pWebBrowser2
= info
->web_browser
;
728 IWebBrowser2_GoBack(pWebBrowser2
);
731 IWebBrowser2_GoForward(pWebBrowser2
);
734 IWebBrowser2_GoHome(pWebBrowser2
);
737 IWebBrowser2_GoSearch(pWebBrowser2
);
740 IWebBrowser2_Refresh(pWebBrowser2
);
742 IWebBrowser2_Stop(pWebBrowser2
);