Exemple #1
0
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;
}
Exemple #2
0
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);
}