comdlg32: Scale the control size limits with dpi.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-05-04 19:31:34 +01:00 committed by Alexandre Julliard
parent b7198efd42
commit 6df0198a2b
1 changed files with 5 additions and 1 deletions

View File

@ -856,7 +856,7 @@ static inline customctrl *get_cctrl(FileDialogImpl *This, DWORD ctlid)
static void ctrl_resize(HWND hctrl, UINT min_width, UINT max_width, BOOL multiline)
{
LPWSTR text;
UINT len, final_width;
UINT len, final_width, dpi;
UINT lines, final_height;
SIZE size;
RECT rc;
@ -872,8 +872,12 @@ static void ctrl_resize(HWND hctrl, UINT min_width, UINT max_width, BOOL multili
hdc = GetDC(hctrl);
GetTextExtentPoint32W(hdc, text, lstrlenW(text), &size);
dpi = GetDeviceCaps(hdc, LOGPIXELSX);
ReleaseDC(hctrl, hdc);
min_width = MulDiv(min_width, dpi, USER_DEFAULT_SCREEN_DPI);
max_width = MulDiv(max_width, dpi, USER_DEFAULT_SCREEN_DPI);
if(len && multiline)
{
/* FIXME: line-wrap */