Added OLEIVERB_INPLACEACTIVATE implementation in IOleObject::DoVerb.
This commit is contained in:
parent
6bd1625f57
commit
a34eaa3c21
@ -138,15 +138,58 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tag
|
|||||||
LPOLECLIENTSITE pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
|
LPOLECLIENTSITE pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
|
||||||
{
|
{
|
||||||
WebBrowser *This = OLEOBJ_THIS(iface);
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
||||||
FIXME("(%p)->(%ld %p %p %ld %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent,
|
HRESULT hres;
|
||||||
|
|
||||||
|
TRACE("(%p)->(%ld %p %p %ld %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent,
|
||||||
lprcPosRect);
|
lprcPosRect);
|
||||||
|
|
||||||
switch (iVerb)
|
switch (iVerb)
|
||||||
{
|
{
|
||||||
case OLEIVERB_INPLACEACTIVATE:
|
case OLEIVERB_INPLACEACTIVATE: {
|
||||||
FIXME ("stub for OLEIVERB_INPLACEACTIVATE\n");
|
IOleInPlaceSite *inplace;
|
||||||
break;
|
|
||||||
case OLEIVERB_HIDE:
|
TRACE("OLEIVERB_INPLACEACTIVATE\n");
|
||||||
FIXME ("stub for OLEIVERB_HIDE\n");
|
|
||||||
|
if(!pActiveSite)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
hres = IOleClientSite_QueryInterface(pActiveSite, &IID_IOleInPlaceSite, (void**)&inplace);
|
||||||
|
if(FAILED(hres)) {
|
||||||
|
WARN("Could not get IOleInPlaceSite\n");
|
||||||
|
return hres;
|
||||||
|
}
|
||||||
|
|
||||||
|
hres = IOleInPlaceSite_CanInPlaceActivate(inplace);
|
||||||
|
if(hres != S_OK) {
|
||||||
|
WARN("CanInPlaceActivate returned: %08lx\n", hres);
|
||||||
|
IOleInPlaceSite_Release(inplace);
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
hres = IOleInPlaceSite_GetWindow(inplace, &This->iphwnd);
|
||||||
|
if(FAILED(hres))
|
||||||
|
This->iphwnd = hwndParent;
|
||||||
|
|
||||||
|
IOleInPlaceSite_OnInPlaceActivate(inplace);
|
||||||
|
|
||||||
|
IOleInPlaceSite_GetWindowContext(inplace, &This->frame, &This->uiwindow,
|
||||||
|
&This->pos_rect, &This->clip_rect,
|
||||||
|
&This->frameinfo);
|
||||||
|
|
||||||
|
IOleInPlaceSite_Release(inplace);
|
||||||
|
|
||||||
|
if(This->client) {
|
||||||
|
IOleClientSite_ShowObject(This->client);
|
||||||
|
IOleClientSite_GetContainer(This->client, &This->container);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(This->frame)
|
||||||
|
IOleInPlaceFrame_GetWindow(This->frame, &This->frame_hwnd);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
FIXME("stub for %ld\n", iVerb);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,4 +493,25 @@ void WebBrowser_OleObject_Init(WebBrowser *This)
|
|||||||
This->lpOleControlVtbl = &OleControlVtbl;
|
This->lpOleControlVtbl = &OleControlVtbl;
|
||||||
|
|
||||||
This->client = NULL;
|
This->client = NULL;
|
||||||
|
This->container = NULL;
|
||||||
|
This->iphwnd = NULL;
|
||||||
|
This->frame_hwnd = NULL;
|
||||||
|
This->frame = NULL;
|
||||||
|
This->uiwindow = NULL;
|
||||||
|
|
||||||
|
memset(&This->pos_rect, 0, sizeof(RECT));
|
||||||
|
memset(&This->clip_rect, 0, sizeof(RECT));
|
||||||
|
memset(&This->frameinfo, 0, sizeof(OLEINPLACEFRAMEINFO));
|
||||||
|
}
|
||||||
|
|
||||||
|
void WebBrowser_OleObject_Destroy(WebBrowser *This)
|
||||||
|
{
|
||||||
|
if(This->client)
|
||||||
|
IOleClientSite_Release(This->client);
|
||||||
|
if(This->container)
|
||||||
|
IOleContainer_Release(This->container);
|
||||||
|
if(This->frame)
|
||||||
|
IOleInPlaceFrame_Release(This->frame);
|
||||||
|
if(This->uiwindow)
|
||||||
|
IOleInPlaceUIWindow_Release(This->uiwindow);
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,17 @@ typedef struct {
|
|||||||
IUnknown *document;
|
IUnknown *document;
|
||||||
|
|
||||||
IOleClientSite *client;
|
IOleClientSite *client;
|
||||||
|
IOleContainer *container;
|
||||||
|
|
||||||
|
/* window context */
|
||||||
|
|
||||||
|
HWND iphwnd;
|
||||||
|
HWND frame_hwnd;
|
||||||
|
IOleInPlaceFrame *frame;
|
||||||
|
IOleInPlaceUIWindow *uiwindow;
|
||||||
|
RECT pos_rect;
|
||||||
|
RECT clip_rect;
|
||||||
|
OLEINPLACEFRAMEINFO frameinfo;
|
||||||
} WebBrowser;
|
} WebBrowser;
|
||||||
|
|
||||||
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
|
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
|
||||||
@ -108,6 +119,8 @@ void WebBrowser_Events_Init(WebBrowser*);
|
|||||||
|
|
||||||
void WebBrowser_ClientSite_Init(WebBrowser*);
|
void WebBrowser_ClientSite_Init(WebBrowser*);
|
||||||
|
|
||||||
|
void WebBrowser_OleObject_Destroy(WebBrowser*);
|
||||||
|
|
||||||
HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
|
HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
@ -121,12 +121,11 @@ static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
|
|||||||
TRACE("(%p) ref=%ld\n", This, ref);
|
TRACE("(%p) ref=%ld\n", This, ref);
|
||||||
|
|
||||||
if(!ref) {
|
if(!ref) {
|
||||||
if(This->client)
|
|
||||||
IOleClientSite_Release(This->client);
|
|
||||||
|
|
||||||
if(This->document)
|
if(This->document)
|
||||||
IUnknown_Release(This->document);
|
IUnknown_Release(This->document);
|
||||||
|
|
||||||
|
WebBrowser_OleObject_Destroy(This);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
SHDOCVW_UnlockModule();
|
SHDOCVW_UnlockModule();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user