Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- 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;
Hi Dmitry,
On 19/06/2020 05:19, Dmitry Timoshkov wrote:
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
dlls/ieframe/oleobject.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Could you please add a test? We already have some SetExtent() tests and you can use GetWindow() to get the window handle there.
Thanks,
Jacek
Hi Jacek,
Jacek Caban jacek@codeweavers.com wrote:
Could you please add a test? We already have some SetExtent() tests and you can use GetWindow() to get the window handle there.
Thanks for the review. I've added some tests and they show that ::SetExtent() should not immediately resize the Shell embedding window, it looks like that the window gets resized during UI activation. However, the application that I have here calls ::SetExtent() (and nothing else) from its main window WM_SIZE handler, and under Windows the contents size follows main window size, but under Wine contents size keeps original (wrong) values. Do you have an idea what might be wrong, and how this behaviour could be tested?
On 22.06.2020 11:40, Dmitry Timoshkov wrote:
Hi Jacek,
Jacek Caban jacek@codeweavers.com wrote:
Could you please add a test? We already have some SetExtent() tests and you can use GetWindow() to get the window handle there.
Thanks for the review. I've added some tests and they show that ::SetExtent() should not immediately resize the Shell embedding window, it looks like that the window gets resized during UI activation. However, the application that I have here calls ::SetExtent() (and nothing else) from its main window WM_SIZE handler, and under Windows the contents size follows main window size, but under Wine contents size keeps original (wrong) values. Do you have an idea what might be wrong, and how this behaviour could be tested?
I don't know, it will need more experimenting. Maybe we'd need to pump messages in tests for this call to take place? Or maybe something else specific to embedder (eg. its IOleInPlaceSite implementation) changes the behaviour.
Thanks,
Jacek