2 * Implementation of IOleObject interfaces for WebBrowser control
8 * Copyright 2001 John R. Sheets (for CodeWeavers)
9 * Copyright 2005 Jacek Caban
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
32 static ATOM shell_embedding_atom = 0;
34 static LRESULT resize_window(WebBrowser *This, LONG width, LONG height)
36 if(This->doc_host.hwnd)
37 SetWindowPos(This->doc_host.hwnd, NULL, 0, 0, width, height,
38 SWP_NOZORDER | SWP_NOACTIVATE);
43 static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
47 static const WCHAR wszTHIS[] = {'T','H','I','S',0};
49 if(msg == WM_CREATE) {
50 This = *(WebBrowser**)lParam;
51 SetPropW(hwnd, wszTHIS, This);
53 This = GetPropW(hwnd, wszTHIS);
58 return resize_window(This, LOWORD(lParam), HIWORD(lParam));
61 return DefWindowProcW(hwnd, msg, wParam, lParam);
64 static void create_shell_embedding_hwnd(WebBrowser *This)
66 IOleInPlaceSite *inplace;
70 static const WCHAR wszShellEmbedding[] =
71 {'S','h','e','l','l',' ','E','m','b','e','d','d','i','n','g',0};
73 if(!shell_embedding_atom) {
74 static WNDCLASSEXW wndclass = {
78 0, 0 /* native uses 8 */, NULL, NULL, NULL,
79 (HBRUSH)COLOR_WINDOWFRAME, NULL,
83 wndclass.hInstance = shdocvw_hinstance;
85 RegisterClassExW(&wndclass);
88 hres = IOleClientSite_QueryInterface(This->client, &IID_IOleInPlaceSite, (void**)&inplace);
90 IOleInPlaceSite_GetWindow(inplace, &parent);
91 IOleInPlaceSite_Release(inplace);
94 This->doc_host.frame_hwnd = This->shell_embedding_hwnd = CreateWindowExW(
96 wszShellEmbedding, wszShellEmbedding,
97 WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP,
99 NULL, shdocvw_hinstance, This);
102 static HRESULT activate_inplace(WebBrowser *This, IOleClientSite *active_site, HWND parent_hwnd)
112 hres = IOleClientSite_QueryInterface(active_site, &IID_IOleInPlaceSite,
113 (void**)&This->inplace);
115 WARN("Could not get IOleInPlaceSite\n");
119 hres = IOleInPlaceSite_CanInPlaceActivate(This->inplace);
121 WARN("CanInPlaceActivate returned: %08lx\n", hres);
122 IOleInPlaceSite_Release(This->inplace);
126 hres = IOleInPlaceSite_GetWindow(This->inplace, &This->iphwnd);
128 This->iphwnd = parent_hwnd;
130 IOleInPlaceSite_OnInPlaceActivate(This->inplace);
132 IOleInPlaceSite_GetWindowContext(This->inplace, &This->frame, &This->uiwindow,
133 &This->pos_rect, &This->clip_rect,
136 SetWindowPos(This->shell_embedding_hwnd, NULL,
137 This->pos_rect.left, This->pos_rect.top,
138 This->pos_rect.right-This->pos_rect.left,
139 This->pos_rect.bottom-This->pos_rect.top,
140 SWP_NOZORDER | SWP_SHOWWINDOW);
143 IOleClientSite_ShowObject(This->client);
144 IOleClientSite_GetContainer(This->client, &This->container);
148 IOleInPlaceFrame_GetWindow(This->frame, &This->frame_hwnd);
153 static HRESULT activate_ui(WebBrowser *This, IOleClientSite *active_site, HWND parent_hwnd)
157 static const WCHAR wszitem[] = {'i','t','e','m',0};
162 hres = activate_inplace(This, active_site, parent_hwnd);
166 IOleInPlaceSite_OnUIActivate(This->inplace);
169 IOleInPlaceFrame_SetActiveObject(This->frame, ACTIVEOBJ(This), wszitem);
171 IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, ACTIVEOBJ(This), wszitem);
174 * IOleInPlaceFrmae_SetMenu
177 SetFocus(This->shell_embedding_hwnd);
182 /**********************************************************************
183 * Implement the IOleObject interface for the WebBrowser control
186 #define OLEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleObject, iface)
188 static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv)
190 WebBrowser *This = OLEOBJ_THIS(iface);
191 return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppv);
194 static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
196 WebBrowser *This = OLEOBJ_THIS(iface);
197 return IWebBrowser_AddRef(WEBBROWSER(This));
200 static ULONG WINAPI OleObject_Release(IOleObject *iface)
202 WebBrowser *This = OLEOBJ_THIS(iface);
203 return IWebBrowser_Release(WEBBROWSER(This));
206 static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE pClientSite)
208 WebBrowser *This = OLEOBJ_THIS(iface);
211 TRACE("(%p)->(%p)\n", This, pClientSite);
213 if(This->client == pClientSite)
216 if(This->doc_host.hwnd) {
217 DestroyWindow(This->doc_host.hwnd);
218 This->doc_host.hwnd = NULL;
220 if(This->shell_embedding_hwnd) {
221 DestroyWindow(This->shell_embedding_hwnd);
222 This->shell_embedding_hwnd = NULL;
226 IOleInPlaceSite_Release(This->inplace);
227 This->inplace = NULL;
230 if(This->doc_host.hostui)
231 IDocHostUIHandler_Release(This->doc_host.hostui);
233 IOleClientSite_Release(This->client);
236 if(This->doc_host.document)
237 deactivate_document(&This->doc_host);
242 This->client = pClientSite;
243 IOleClientSite_AddRef(pClientSite);
245 hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
246 (void**)&This->doc_host.hostui);
248 This->doc_host.hostui = NULL;
250 create_shell_embedding_hwnd(This);
255 static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, LPOLECLIENTSITE *ppClientSite)
257 WebBrowser *This = OLEOBJ_THIS(iface);
259 TRACE("(%p)->(%p)\n", This, ppClientSite);
265 IOleClientSite_AddRef(This->client);
266 *ppClientSite = This->client;
271 static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp,
272 LPCOLESTR szContainerObj)
274 WebBrowser *This = OLEOBJ_THIS(iface);
275 FIXME("(%p)->(%s, %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj));
279 static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
281 WebBrowser *This = OLEOBJ_THIS(iface);
282 FIXME("(%p)->(%ld)\n", This, dwSaveOption);
286 static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker* pmk)
288 WebBrowser *This = OLEOBJ_THIS(iface);
289 FIXME("(%p)->(%ld, %p)\n", This, dwWhichMoniker, pmk);
293 static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign,
294 DWORD dwWhichMoniker, LPMONIKER *ppmk)
296 WebBrowser *This = OLEOBJ_THIS(iface);
297 FIXME("(%p)->(%ld, %ld, %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
301 static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, LPDATAOBJECT pDataObject,
302 BOOL fCreation, DWORD dwReserved)
304 WebBrowser *This = OLEOBJ_THIS(iface);
305 FIXME("(%p)->(%p, %d, %ld)\n", This, pDataObject, fCreation, dwReserved);
309 static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved,
310 LPDATAOBJECT *ppDataObject)
312 WebBrowser *This = OLEOBJ_THIS(iface);
313 FIXME("(%p)->(%ld, %p)\n", This, dwReserved, ppDataObject);
317 static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tagMSG* lpmsg,
318 LPOLECLIENTSITE pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
320 WebBrowser *This = OLEOBJ_THIS(iface);
322 TRACE("(%p)->(%ld %p %p %ld %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent,
328 TRACE("OLEIVERB_SHOW\n");
329 return activate_ui(This, pActiveSite, hwndParent);
330 case OLEIVERB_UIACTIVATE:
331 TRACE("OLEIVERB_UIACTIVATE\n");
332 return activate_ui(This, pActiveSite, hwndParent);
333 case OLEIVERB_INPLACEACTIVATE:
334 TRACE("OLEIVERB_INPLACEACTIVATE\n");
335 return activate_inplace(This, pActiveSite, hwndParent);
337 FIXME("stub for %ld\n", iVerb);
344 static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
346 WebBrowser *This = OLEOBJ_THIS(iface);
347 TRACE("(%p)->(%p)\n", This, ppEnumOleVerb);
348 return OleRegEnumVerbs(&CLSID_WebBrowser, ppEnumOleVerb);
351 static HRESULT WINAPI OleObject_Update(IOleObject *iface)
353 WebBrowser *This = OLEOBJ_THIS(iface);
354 FIXME("(%p)\n", This);
358 static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
360 WebBrowser *This = OLEOBJ_THIS(iface);
361 FIXME("(%p)\n", This);
365 static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID* pClsid)
367 WebBrowser *This = OLEOBJ_THIS(iface);
368 FIXME("(%p)->(%p)\n", This, pClsid);
372 static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType,
373 LPOLESTR* pszUserType)
375 WebBrowser *This = OLEOBJ_THIS(iface);
376 TRACE("(%p, %ld, %p)\n", This, dwFormOfType, pszUserType);
377 return OleRegGetUserType(&CLSID_WebBrowser, dwFormOfType, pszUserType);
380 static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
382 WebBrowser *This = OLEOBJ_THIS(iface);
383 FIXME("(%p)->(%lx %p)\n", This, dwDrawAspect, psizel);
387 static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
389 WebBrowser *This = OLEOBJ_THIS(iface);
390 FIXME("(%p)->(%lx, %p)\n", This, dwDrawAspect, psizel);
394 static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink,
395 DWORD* pdwConnection)
397 WebBrowser *This = OLEOBJ_THIS(iface);
398 FIXME("(%p)->(%p, %p)\n", This, pAdvSink, pdwConnection);
402 static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection)
404 WebBrowser *This = OLEOBJ_THIS(iface);
405 FIXME("(%p)->(%ld)\n", This, dwConnection);
409 static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
411 WebBrowser *This = OLEOBJ_THIS(iface);
412 FIXME("(%p)->(%p)\n", This, ppenumAdvise);
416 static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
418 WebBrowser *This = OLEOBJ_THIS(iface);
420 TRACE("(%p)->(%lx, %p)\n", This, dwAspect, pdwStatus);
422 *pdwStatus = OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_INSIDEOUT
423 |OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE;
428 static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE* pLogpal)
430 WebBrowser *This = OLEOBJ_THIS(iface);
431 FIXME("(%p)->(%p)\n", This, pLogpal);
437 static const IOleObjectVtbl OleObjectVtbl =
439 OleObject_QueryInterface,
442 OleObject_SetClientSite,
443 OleObject_GetClientSite,
444 OleObject_SetHostNames,
446 OleObject_SetMoniker,
447 OleObject_GetMoniker,
448 OleObject_InitFromData,
449 OleObject_GetClipboardData,
453 OleObject_IsUpToDate,
454 OleObject_GetUserClassID,
455 OleObject_GetUserType,
460 OleObject_EnumAdvise,
461 OleObject_GetMiscStatus,
462 OleObject_SetColorScheme
465 /**********************************************************************
466 * Implement the IOleInPlaceObject interface
469 #define INPLACEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceObject, iface)
471 static HRESULT WINAPI OleInPlaceObject_QueryInterface(IOleInPlaceObject *iface,
472 REFIID riid, LPVOID *ppobj)
474 WebBrowser *This = INPLACEOBJ_THIS(iface);
475 return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
478 static ULONG WINAPI OleInPlaceObject_AddRef(IOleInPlaceObject *iface)
480 WebBrowser *This = INPLACEOBJ_THIS(iface);
481 return IWebBrowser_AddRef(WEBBROWSER(This));
484 static ULONG WINAPI OleInPlaceObject_Release(IOleInPlaceObject *iface)
486 WebBrowser *This = INPLACEOBJ_THIS(iface);
487 return IWebBrowser_Release(WEBBROWSER(This));
490 static HRESULT WINAPI OleInPlaceObject_GetWindow(IOleInPlaceObject *iface, HWND* phwnd)
492 WebBrowser *This = INPLACEOBJ_THIS(iface);
494 TRACE("(%p)->(%p)\n", This, phwnd);
496 *phwnd = This->shell_embedding_hwnd;
500 static HRESULT WINAPI OleInPlaceObject_ContextSensitiveHelp(IOleInPlaceObject *iface,
503 WebBrowser *This = INPLACEOBJ_THIS(iface);
504 FIXME("(%p)->(%x)\n", This, fEnterMode);
508 static HRESULT WINAPI OleInPlaceObject_InPlaceDeactivate(IOleInPlaceObject *iface)
510 WebBrowser *This = INPLACEOBJ_THIS(iface);
511 FIXME("(%p)\n", This);
515 static HRESULT WINAPI OleInPlaceObject_UIDeactivate(IOleInPlaceObject *iface)
517 WebBrowser *This = INPLACEOBJ_THIS(iface);
518 FIXME("(%p)\n", This);
522 static HRESULT WINAPI OleInPlaceObject_SetObjectRects(IOleInPlaceObject *iface,
523 LPCRECT lprcPosRect, LPCRECT lprcClipRect)
525 WebBrowser *This = INPLACEOBJ_THIS(iface);
527 TRACE("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
529 memcpy(&This->pos_rect, lprcPosRect, sizeof(RECT));
532 memcpy(&This->clip_rect, lprcClipRect, sizeof(RECT));
534 if(This->shell_embedding_hwnd) {
535 SetWindowPos(This->shell_embedding_hwnd, NULL,
536 lprcPosRect->left, lprcPosRect->top,
537 lprcPosRect->right-lprcPosRect->left,
538 lprcPosRect->bottom-lprcPosRect->top,
539 SWP_NOZORDER | SWP_NOACTIVATE);
545 static HRESULT WINAPI OleInPlaceObject_ReactivateAndUndo(IOleInPlaceObject *iface)
547 WebBrowser *This = INPLACEOBJ_THIS(iface);
548 FIXME("(%p)\n", This);
552 #undef INPLACEOBJ_THIS
554 static const IOleInPlaceObjectVtbl OleInPlaceObjectVtbl =
556 OleInPlaceObject_QueryInterface,
557 OleInPlaceObject_AddRef,
558 OleInPlaceObject_Release,
559 OleInPlaceObject_GetWindow,
560 OleInPlaceObject_ContextSensitiveHelp,
561 OleInPlaceObject_InPlaceDeactivate,
562 OleInPlaceObject_UIDeactivate,
563 OleInPlaceObject_SetObjectRects,
564 OleInPlaceObject_ReactivateAndUndo
567 /**********************************************************************
568 * Implement the IOleControl interface
571 #define CONTROL_THIS(iface) DEFINE_THIS(WebBrowser, OleControl, iface)
573 static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface,
574 REFIID riid, LPVOID *ppobj)
576 WebBrowser *This = CONTROL_THIS(iface);
577 return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
580 static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
582 WebBrowser *This = CONTROL_THIS(iface);
583 return IWebBrowser_AddRef(WEBBROWSER(This));
586 static ULONG WINAPI OleControl_Release(IOleControl *iface)
588 WebBrowser *This = CONTROL_THIS(iface);
589 return IWebBrowser_Release(WEBBROWSER(This));
592 static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, LPCONTROLINFO pCI)
594 WebBrowser *This = CONTROL_THIS(iface);
595 FIXME("(%p)->(%p)\n", This, pCI);
599 static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, struct tagMSG *pMsg)
601 WebBrowser *This = CONTROL_THIS(iface);
602 FIXME("(%p)->(%p)\n", This, pMsg);
606 static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
608 WebBrowser *This = CONTROL_THIS(iface);
609 FIXME("(%p)->(%ld)\n", This, dispID);
613 static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze)
615 WebBrowser *This = CONTROL_THIS(iface);
616 FIXME("(%p)->(%x)\n", This, bFreeze);
622 static const IOleControlVtbl OleControlVtbl =
624 OleControl_QueryInterface,
627 OleControl_GetControlInfo,
628 OleControl_OnMnemonic,
629 OleControl_OnAmbientPropertyChange,
630 OleControl_FreezeEvents
633 #define ACTIVEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceActiveObject, iface)
635 static HRESULT WINAPI InPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface,
636 REFIID riid, void **ppv)
638 WebBrowser *This = ACTIVEOBJ_THIS(iface);
639 return IWebBrowser2_QueryInterface(WEBBROWSER2(This), riid, ppv);
642 static ULONG WINAPI InPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface)
644 WebBrowser *This = ACTIVEOBJ_THIS(iface);
645 return IWebBrowser2_AddRef(WEBBROWSER2(This));
648 static ULONG WINAPI InPlaceActiveObject_Release(IOleInPlaceActiveObject *iface)
650 WebBrowser *This = ACTIVEOBJ_THIS(iface);
651 return IWebBrowser2_Release(WEBBROWSER2(This));
654 static HRESULT WINAPI InPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface,
657 WebBrowser *This = ACTIVEOBJ_THIS(iface);
658 return IOleInPlaceObject_GetWindow(INPLACEOBJ(This), phwnd);
661 static HRESULT WINAPI InPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface,
664 WebBrowser *This = ACTIVEOBJ_THIS(iface);
665 return IOleInPlaceObject_ContextSensitiveHelp(INPLACEOBJ(This), fEnterMode);
668 static HRESULT WINAPI InPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface,
671 WebBrowser *This = ACTIVEOBJ_THIS(iface);
672 FIXME("(%p)->(%p)\n", This, lpmsg);
676 static HRESULT WINAPI InPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface,
679 WebBrowser *This = ACTIVEOBJ_THIS(iface);
680 FIXME("(%p)->(%x)\n", This, fActivate);
684 static HRESULT WINAPI InPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface,
687 WebBrowser *This = ACTIVEOBJ_THIS(iface);
688 FIXME("(%p)->(%x)\n", This, fActivate);
692 static HRESULT WINAPI InPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface,
693 LPCRECT lprcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
695 WebBrowser *This = ACTIVEOBJ_THIS(iface);
696 FIXME("(%p)->(%p %p %x)\n", This, lprcBorder, pUIWindow, fFrameWindow);
700 static HRESULT WINAPI InPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface,
703 WebBrowser *This = ACTIVEOBJ_THIS(iface);
704 FIXME("(%p)->(%x)\n", This, fEnable);
708 #undef ACTIVEOBJ_THIS
710 static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
711 InPlaceActiveObject_QueryInterface,
712 InPlaceActiveObject_AddRef,
713 InPlaceActiveObject_Release,
714 InPlaceActiveObject_GetWindow,
715 InPlaceActiveObject_ContextSensitiveHelp,
716 InPlaceActiveObject_TranslateAccelerator,
717 InPlaceActiveObject_OnFrameWindowActivate,
718 InPlaceActiveObject_OnDocWindowActivate,
719 InPlaceActiveObject_ResizeBorder,
720 InPlaceActiveObject_EnableModeless
723 #define OLECMD_THIS(iface) DEFINE_THIS(WebBrowser, OleCommandTarget, iface)
725 static HRESULT WINAPI WBOleCommandTarget_QueryInterface(IOleCommandTarget *iface,
726 REFIID riid, void **ppv)
728 WebBrowser *This = OLECMD_THIS(iface);
729 return IWebBrowser2_QueryInterface(WEBBROWSER(This), riid, ppv);
732 static ULONG WINAPI WBOleCommandTarget_AddRef(IOleCommandTarget *iface)
734 WebBrowser *This = OLECMD_THIS(iface);
735 return IWebBrowser2_AddRef(WEBBROWSER(This));
738 static ULONG WINAPI WBOleCommandTarget_Release(IOleCommandTarget *iface)
740 WebBrowser *This = OLECMD_THIS(iface);
741 return IWebBrowser2_Release(WEBBROWSER(This));
744 static HRESULT WINAPI WBOleCommandTarget_QueryStatus(IOleCommandTarget *iface,
745 const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
747 WebBrowser *This = OLECMD_THIS(iface);
748 FIXME("(%p)->(%s %lu %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds,
753 static HRESULT WINAPI WBOleCommandTarget_Exec(IOleCommandTarget *iface,
754 const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn,
757 WebBrowser *This = OLECMD_THIS(iface);
758 FIXME("(%p)->(%s %ld %ld %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID,
759 nCmdexecopt, pvaIn, pvaOut);
765 static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
766 WBOleCommandTarget_QueryInterface,
767 WBOleCommandTarget_AddRef,
768 WBOleCommandTarget_Release,
769 WBOleCommandTarget_QueryStatus,
770 WBOleCommandTarget_Exec
773 void WebBrowser_OleObject_Init(WebBrowser *This)
775 This->lpOleObjectVtbl = &OleObjectVtbl;
776 This->lpOleInPlaceObjectVtbl = &OleInPlaceObjectVtbl;
777 This->lpOleControlVtbl = &OleControlVtbl;
778 This->lpOleInPlaceActiveObjectVtbl = &OleInPlaceActiveObjectVtbl;
779 This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
782 This->inplace = NULL;
783 This->container = NULL;
785 This->frame_hwnd = NULL;
787 This->uiwindow = NULL;
788 This->shell_embedding_hwnd = NULL;
790 memset(&This->pos_rect, 0, sizeof(RECT));
791 memset(&This->clip_rect, 0, sizeof(RECT));
792 memset(&This->frameinfo, 0, sizeof(OLEINPLACEFRAMEINFO));
795 void WebBrowser_OleObject_Destroy(WebBrowser *This)
798 IOleObject_SetClientSite(OLEOBJ(This), NULL);
800 IOleContainer_Release(This->container);
802 IOleInPlaceFrame_Release(This->frame);
804 IOleInPlaceUIWindow_Release(This->uiwindow);