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
, (void **)&inplace
))
369 IOleInPlaceObject_SetObjectRects(inplace
, lprcPosRect
, lprcPosRect
);
374 static const IOleInPlaceSiteVtbl MyIOleInPlaceSiteTable
=
376 InPlace_QueryInterface
,
380 InPlace_ContextSensitiveHelp
,
381 InPlace_CanInPlaceActivate
,
382 InPlace_OnInPlaceActivate
,
383 InPlace_OnUIActivate
,
384 InPlace_GetWindowContext
,
386 InPlace_OnUIDeactivate
,
387 InPlace_OnInPlaceDeactivate
,
388 InPlace_DiscardUndoState
,
389 InPlace_DeactivateAndUndo
,
390 InPlace_OnPosRectChange
393 static HRESULT STDMETHODCALLTYPE
Frame_QueryInterface(IOleInPlaceFrame
*iface
, REFIID riid
, LPVOID
*ppvObj
)
395 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceFrame
, iface
);
397 return IOleClientSite_QueryInterface(CLIENTSITE(This
), riid
, ppvObj
);
400 static ULONG STDMETHODCALLTYPE
Frame_AddRef(IOleInPlaceFrame
*iface
)
402 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceFrame
, iface
);
404 return IOleClientSite_AddRef(CLIENTSITE(This
));
407 static ULONG STDMETHODCALLTYPE
Frame_Release(IOleInPlaceFrame
*iface
)
409 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceFrame
, iface
);
411 return IOleClientSite_Release(CLIENTSITE(This
));
414 static HRESULT STDMETHODCALLTYPE
Frame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*lphwnd
)
416 ICOM_THIS_MULTI(IOleClientSiteImpl
, lpvtblOleInPlaceFrame
, iface
);
417 *lphwnd
= This
->hwndWindow
;
422 static HRESULT STDMETHODCALLTYPE
Frame_ContextSensitiveHelp(IOleInPlaceFrame
*iface
, BOOL fEnterMode
)
427 static HRESULT STDMETHODCALLTYPE
Frame_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
432 static HRESULT STDMETHODCALLTYPE
Frame_RequestBorderSpace(IOleInPlaceFrame
*iface
, LPCBORDERWIDTHS pborderwidths
)
437 static HRESULT STDMETHODCALLTYPE
Frame_SetBorderSpace(IOleInPlaceFrame
*iface
, LPCBORDERWIDTHS pborderwidths
)
442 static HRESULT STDMETHODCALLTYPE
Frame_SetActiveObject(IOleInPlaceFrame
*iface
, IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
447 static HRESULT STDMETHODCALLTYPE
Frame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
, LPOLEMENUGROUPWIDTHS lpMenuWidths
)
452 static HRESULT STDMETHODCALLTYPE
Frame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
, HOLEMENU holemenu
, HWND hwndActiveObject
)
457 static HRESULT STDMETHODCALLTYPE
Frame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
462 static HRESULT STDMETHODCALLTYPE
Frame_SetStatusText(IOleInPlaceFrame
*iface
, LPCOLESTR pszStatusText
)
467 static HRESULT STDMETHODCALLTYPE
Frame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
472 static HRESULT STDMETHODCALLTYPE
Frame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
, WORD wID
)
477 static const IOleInPlaceFrameVtbl MyIOleInPlaceFrameTable
=
479 Frame_QueryInterface
,
483 Frame_ContextSensitiveHelp
,
485 Frame_RequestBorderSpace
,
486 Frame_SetBorderSpace
,
487 Frame_SetActiveObject
,
492 Frame_EnableModeless
,
493 Frame_TranslateAccelerator
496 static HRESULT STDMETHODCALLTYPE
Storage_QueryInterface(IStorage
*This
, REFIID riid
, LPVOID
*ppvObj
)
501 static ULONG STDMETHODCALLTYPE
Storage_AddRef(IStorage
*This
)
506 static ULONG STDMETHODCALLTYPE
Storage_Release(IStorage
*This
)
511 static HRESULT STDMETHODCALLTYPE
Storage_CreateStream(IStorage
*This
, const WCHAR
*pwcsName
, DWORD grfMode
, DWORD reserved1
, DWORD reserved2
, IStream
**ppstm
)
516 static HRESULT STDMETHODCALLTYPE
Storage_OpenStream(IStorage
*This
, const WCHAR
* pwcsName
, void *reserved1
, DWORD grfMode
, DWORD reserved2
, IStream
**ppstm
)
521 static HRESULT STDMETHODCALLTYPE
Storage_CreateStorage(IStorage
*This
, const WCHAR
*pwcsName
, DWORD grfMode
, DWORD reserved1
, DWORD reserved2
, IStorage
**ppstg
)
526 static HRESULT STDMETHODCALLTYPE
Storage_OpenStorage(IStorage
*This
, const WCHAR
* pwcsName
, IStorage
* pstgPriority
, DWORD grfMode
, SNB snbExclude
, DWORD reserved
, IStorage
**ppstg
)
531 static HRESULT STDMETHODCALLTYPE
Storage_CopyTo(IStorage
*This
, DWORD ciidExclude
, IID
const *rgiidExclude
, SNB snbExclude
,IStorage
*pstgDest
)
536 static HRESULT STDMETHODCALLTYPE
Storage_MoveElementTo(IStorage
*This
, const OLECHAR
*pwcsName
,IStorage
* pstgDest
, const OLECHAR
*pwcsNewName
, DWORD grfFlags
)
541 static HRESULT STDMETHODCALLTYPE
Storage_Commit(IStorage
*This
, DWORD grfCommitFlags
)
546 static HRESULT STDMETHODCALLTYPE
Storage_Revert(IStorage
*This
)
551 static HRESULT STDMETHODCALLTYPE
Storage_EnumElements(IStorage
*This
, DWORD reserved1
, void *reserved2
, DWORD reserved3
, IEnumSTATSTG
**ppenum
)
556 static HRESULT STDMETHODCALLTYPE
Storage_DestroyElement(IStorage
*This
, const OLECHAR
*pwcsName
)
561 static HRESULT STDMETHODCALLTYPE
Storage_RenameElement(IStorage
*This
, const WCHAR
*pwcsOldName
, const WCHAR
*pwcsNewName
)
566 static HRESULT STDMETHODCALLTYPE
Storage_SetElementTimes(IStorage
*This
, const WCHAR
*pwcsName
, FILETIME
const *pctime
, FILETIME
const *patime
, FILETIME
const *pmtime
)
571 static HRESULT STDMETHODCALLTYPE
Storage_SetClass(IStorage
*This
, REFCLSID clsid
)
576 static HRESULT STDMETHODCALLTYPE
Storage_SetStateBits(IStorage
*This
, DWORD grfStateBits
, DWORD grfMask
)
581 static HRESULT STDMETHODCALLTYPE
Storage_Stat(IStorage
*This
, STATSTG
*pstatstg
, DWORD grfStatFlag
)
586 static const IStorageVtbl MyIStorageTable
=
588 Storage_QueryInterface
,
591 Storage_CreateStream
,
593 Storage_CreateStorage
,
596 Storage_MoveElementTo
,
599 Storage_EnumElements
,
600 Storage_DestroyElement
,
601 Storage_RenameElement
,
602 Storage_SetElementTimes
,
604 Storage_SetStateBits
,
608 static IStorage MyIStorage
= { &MyIStorageTable
};
610 BOOL
InitWebBrowser(HHInfo
*info
, HWND hwndParent
)
612 IOleClientSiteImpl
*iOleClientSiteImpl
;
613 IOleInPlaceObject
*inplace
;
614 IOleObject
*browserObject
;
615 IWebBrowser2
*webBrowser2
;
619 iOleClientSiteImpl
= heap_alloc_zero(sizeof(IOleClientSiteImpl
));
620 if (!iOleClientSiteImpl
)
623 iOleClientSiteImpl
->ref
= 1;
624 iOleClientSiteImpl
->lpVtbl
= &MyIOleClientSiteTable
;
625 iOleClientSiteImpl
->lpvtblOleInPlaceSite
= &MyIOleInPlaceSiteTable
;
626 iOleClientSiteImpl
->lpvtblOleInPlaceFrame
= &MyIOleInPlaceFrameTable
;
627 iOleClientSiteImpl
->hwndWindow
= hwndParent
;
628 iOleClientSiteImpl
->lpvtblDocHostUIHandler
= &MyIDocHostUIHandlerTable
;
630 hr
= OleCreate(&CLSID_WebBrowser
, &IID_IOleObject
, OLERENDER_DRAW
, 0,
631 (IOleClientSite
*)iOleClientSiteImpl
, &MyIStorage
,
632 (void **)&browserObject
);
634 info
->client_site
= (IOleClientSite
*)iOleClientSiteImpl
;
635 info
->wb_object
= browserObject
;
637 if (FAILED(hr
)) goto error
;
639 /* make the browser object accessible to the IOleClientSite implementation */
640 iOleClientSiteImpl
->pBrowserObject
= browserObject
;
642 GetClientRect(hwndParent
, &rc
);
644 hr
= OleSetContainedObject((struct IUnknown
*)browserObject
, TRUE
);
645 if (FAILED(hr
)) goto error
;
647 hr
= IOleObject_DoVerb(browserObject
, OLEIVERB_SHOW
, NULL
,
648 (IOleClientSite
*)iOleClientSiteImpl
,
649 -1, hwndParent
, &rc
);
650 if (FAILED(hr
)) goto error
;
652 hr
= IOleObject_QueryInterface(browserObject
, &IID_IOleInPlaceObject
, (void**)&inplace
);
653 if (FAILED(hr
)) goto error
;
655 IOleInPlaceObject_SetObjectRects(inplace
, &rc
, &rc
);
656 IOleInPlaceObject_Release(inplace
);
658 hr
= IOleObject_QueryInterface(browserObject
, &IID_IWebBrowser2
,
659 (void **)&webBrowser2
);
662 info
->web_browser
= webBrowser2
;
667 ReleaseWebBrowser(info
);
668 heap_free(iOleClientSiteImpl
);
673 void ReleaseWebBrowser(HHInfo
*info
)
677 if (info
->web_browser
)
679 IWebBrowser2_Release(info
->web_browser
);
680 info
->web_browser
= NULL
;
683 if (info
->client_site
)
685 IOleClientSite_Release(info
->client_site
);
686 info
->client_site
= NULL
;
689 if(info
->wb_object
) {
690 IOleInPlaceSite
*inplace
;
692 hres
= IOleObject_QueryInterface(info
->wb_object
, &IID_IOleInPlaceSite
, (void**)&inplace
);
693 if(SUCCEEDED(hres
)) {
694 IOleInPlaceSite_OnInPlaceDeactivate(inplace
);
695 IOleInPlaceSite_Release(inplace
);
698 IOleObject_SetClientSite(info
->wb_object
, NULL
);
700 IOleObject_Release(info
->wb_object
);
701 info
->wb_object
= NULL
;
705 void ResizeWebBrowser(HHInfo
*info
, DWORD dwWidth
, DWORD dwHeight
)
707 if (!info
->web_browser
)
710 IWebBrowser2_put_Width(info
->web_browser
, dwWidth
);
711 IWebBrowser2_put_Height(info
->web_browser
, dwHeight
);
714 void DoPageAction(HHInfo
*info
, DWORD dwAction
)
716 IWebBrowser2
*pWebBrowser2
= info
->web_browser
;
724 IWebBrowser2_GoBack(pWebBrowser2
);
727 IWebBrowser2_GoForward(pWebBrowser2
);
730 IWebBrowser2_GoHome(pWebBrowser2
);
733 IWebBrowser2_GoSearch(pWebBrowser2
);
736 IWebBrowser2_Refresh(pWebBrowser2
);
738 IWebBrowser2_Stop(pWebBrowser2
);