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; }