Commit 04a8cff1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

- Better handling of UI and InPlace active state.

- Implemented InPlaceDeactivate. - THIS macros cleanup.
parent 13766712
......@@ -128,13 +128,13 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
if(!ref) {
if(This->client)
IOleClientSite_Release(This->client);
if(This->hostui)
IDocHostUIHandler_Release(This->hostui);
IOleObject_SetClientSite(OLEOBJ(This), NULL);
if(This->in_place_active)
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
if(This->ipsite)
IOleInPlaceSite_Release(This->ipsite);
if(This->frame)
IOleInPlaceFrame_Release(This->frame);
IOleDocumentView_SetInPlaceSite(DOCVIEW(This), NULL);
if(This->hwnd)
DestroyWindow(This->hwnd);
HeapFree(GetProcessHeap(), 0, This);
}
......
......@@ -38,6 +38,9 @@ typedef struct {
IOleInPlaceFrame *frame;
HWND hwnd;
BOOL in_place_active;
BOOL ui_active;
} HTMLDocument;
#define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
......
......@@ -71,6 +71,9 @@ static HRESULT WINAPI OleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *
if(!phwnd)
return E_INVALIDARG;
if(!This->in_place_active)
return E_FAIL;
*phwnd = This->hwnd;
return S_OK;
}
......@@ -175,8 +178,25 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlac
static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
TRACE("(%p)\n", This);
if(!This->in_place_active)
return S_OK;
if(This->frame)
IOleInPlaceFrame_Release(This->frame);
if(This->hwnd) {
ShowWindow(This->hwnd, SW_HIDE);
SetWindowPos(This->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
}
This->in_place_active = FALSE;
if(This->ipsite)
IOleInPlaceSite_OnInPlaceDeactivate(This->ipsite);
return S_OK;
}
static HRESULT WINAPI OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment