Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/trackbar.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index d774823d60..e717528fd4 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -1474,6 +1474,7 @@ TRACKBAR_InitializeThumb (TRACKBAR_INFO *infoPtr) { RECT rect; int clientWidth, clientMetric; + HDC hdc;
/* initial thumb length */ clientMetric = (infoPtr->dwStyle & TBS_ENABLESELRANGE) ? 23 : 21; @@ -1488,6 +1489,10 @@ TRACKBAR_InitializeThumb (TRACKBAR_INFO *infoPtr) else infoPtr->uThumbLen = clientWidth > 9 ? clientWidth - 6 : 4;
+ hdc = GetDC(infoPtr->hwndSelf); + infoPtr->uThumbLen = MulDiv(infoPtr->uThumbLen, GetDeviceCaps(hdc, LOGPIXELSX), 96); + ReleaseDC(infoPtr->hwndSelf, hdc); + TRACKBAR_CalcChannel (infoPtr); TRACKBAR_UpdateThumb (infoPtr); infoPtr->flags &= ~TB_SELECTIONCHANGED;
Nikolay Sivov nsivov@codeweavers.com writes:
@@ -1488,6 +1489,10 @@ TRACKBAR_InitializeThumb (TRACKBAR_INFO *infoPtr) else infoPtr->uThumbLen = clientWidth > 9 ? clientWidth - 6 : 4;
- hdc = GetDC(infoPtr->hwndSelf);
- infoPtr->uThumbLen = MulDiv(infoPtr->uThumbLen, GetDeviceCaps(hdc, LOGPIXELSX), 96);
- ReleaseDC(infoPtr->hwndSelf, hdc);
You probably want to use GetDpiForWindow() instead. Also it seems to me that the check against the client rect should be done after scaling.