Commit 6df0198a authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

comdlg32: Scale the control size limits with dpi.

parent b7198efd
......@@ -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 */
......
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