static HRESULT activate_ui(WebBrowser *This, IOleClientSite *active_site) { HRESULT hres; static const WCHAR wszitem[] = {'i','t','e','m',0}; if(This->inplace) { if(This->shell_embedding_hwnd) ShowWindow(This->shell_embedding_hwnd, SW_SHOW); return S_OK; } hres = activate_inplace(This, active_site); if(FAILED(hres)) return hres; IOleInPlaceSite_OnUIActivate(This->inplace); if(This->doc_host.frame) IOleInPlaceFrame_SetActiveObject(This->doc_host.frame, &This->IOleInPlaceActiveObject_iface, wszitem); if(This->uiwindow) IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, &This->IOleInPlaceActiveObject_iface, wszitem); if(This->doc_host.frame) IOleInPlaceFrame_SetMenu(This->doc_host.frame, NULL, NULL, This->shell_embedding_hwnd); SetFocus(This->shell_embedding_hwnd); return S_OK; }
static HRESULT activate_ui(WebBrowser *This, IOleClientSite *active_site, HWND parent_hwnd) { HRESULT hres; static const WCHAR wszitem[] = {'i','t','e','m',0}; if(This->inplace) return S_OK; hres = activate_inplace(This, active_site, parent_hwnd); if(FAILED(hres)) return hres; IOleInPlaceSite_OnUIActivate(This->inplace); if(This->frame) IOleInPlaceFrame_SetActiveObject(This->frame, ACTIVEOBJ(This), wszitem); if(This->uiwindow) IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, ACTIVEOBJ(This), wszitem); if(This->frame) IOleInPlaceFrame_SetMenu(This->frame, NULL, NULL, This->shell_embedding_hwnd); SetFocus(This->shell_embedding_hwnd); return S_OK; }
static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption) { WebBrowser *This = impl_from_IOleObject(iface); IOleClientSite *client; HRESULT hres; TRACE("(%p)->(%d)\n", This, dwSaveOption); if(dwSaveOption != OLECLOSE_NOSAVE) { FIXME("unimplemented flag: %x\n", dwSaveOption); return E_NOTIMPL; } if(This->doc_host.frame) IOleInPlaceFrame_SetActiveObject(This->doc_host.frame, NULL, NULL); if(This->uiwindow) IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, NULL, NULL); if(This->inplace) IOleInPlaceSiteEx_OnUIDeactivate(This->inplace, FALSE); notify_on_focus(This, FALSE); if(This->inplace) IOleInPlaceSiteEx_OnInPlaceDeactivate(This->inplace); /* store old client site - we need to restore it in DoVerb */ client = This->client; if(This->client) IOleClientSite_AddRef(This->client); hres = IOleObject_SetClientSite(iface, NULL); This->client_closed = client; return hres; }
HRESULT call_set_active_object(IOleInPlaceUIWindow *window, IOleInPlaceActiveObject *act_obj) { static WCHAR html_documentW[30]; if(act_obj && !html_documentW[0]) { LoadStringW(hInst, IDS_HTMLDOCUMENT, html_documentW, sizeof(html_documentW)/sizeof(WCHAR)); } return IOleInPlaceFrame_SetActiveObject(window, act_obj, act_obj ? html_documentW : NULL); }
static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption) { WebBrowser *This = impl_from_IOleObject(iface); TRACE("(%p)->(%d)\n", This, dwSaveOption); if(dwSaveOption != OLECLOSE_NOSAVE) { FIXME("unimplemented flag: %x\n", dwSaveOption); return E_NOTIMPL; } if(This->doc_host.frame) IOleInPlaceFrame_SetActiveObject(This->doc_host.frame, NULL, NULL); if(This->uiwindow) IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, NULL, NULL); if(This->inplace) { IOleInPlaceSiteEx_OnUIDeactivate(This->inplace, FALSE); IOleInPlaceSiteEx_OnInPlaceDeactivate(This->inplace); } return IOleObject_SetClientSite(iface, NULL); }