From: Dmitry Timoshkov Subject: [PATCH] ieframe: IOleObject::SetExtent() should resize the Shell Embedding Window. Message-Id: <20200619111907.66db11b2ab2298b224f52f8c@baikal.ru> Date: Fri, 19 Jun 2020 11:19:07 +0800 Signed-off-by: Dmitry Timoshkov --- dlls/ieframe/oleobject.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/ieframe/oleobject.c b/dlls/ieframe/oleobject.c index 5c49845aa7..b0e166897a 100644 --- a/dlls/ieframe/oleobject.c +++ b/dlls/ieframe/oleobject.c @@ -740,6 +740,22 @@ static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, TRACE("(%p)->(%x %p)\n", This, dwDrawAspect, psizel); + if(This->shell_embedding_hwnd) { + LONG dpi_x, dpi_y, width, height; + HDC hdc; + + hdc = GetDC(0); + dpi_x = GetDeviceCaps(hdc, LOGPIXELSX); + dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(0, hdc); + + width = MulDiv(psizel->cx, dpi_x, 2540); + height = MulDiv(psizel->cy, dpi_y, 2540); + + SetWindowPos(This->shell_embedding_hwnd, NULL, + 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); + } + /* Tests show that dwDrawAspect is ignored */ This->extent = *psizel; return S_OK; -- 2.26.2