comctl32: use GetWindowLong to check for scrollbar (try 2)
Daniel Jelinski
djelinski1 at gmail.com
Fri Sep 28 12:43:46 CDT 2012
Corrected from first try:
- uses GetWindowLong instead of GetWindowLongPtr
- does not touch dwStyle
-------------- next part --------------
From 0b2c12f24cbff32fb881340ef797b4f1c36d78a4 Mon Sep 17 00:00:00 2001
From: Daniel Jelinski <djelinski1 at gmail.com>
Date: Fri, 21 Sep 2012 21:58:43 +0200
Subject: [PATCH] comctl32: use GetWindowLong to check for scrollbar
dwStyle is updated only in WM_STYLECHANGED, which is not sent
when displaying and hiding scrollbars (tested both on Wine and Windows).
As a result, testing for WS_HSCROLL in dwStyle yields incorrect results.
Fixes the issue where there was a large empty margin between items
and horizontal scrollbar (visible e.g. in file open dialog).
---
dlls/comctl32/listview.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 7a11557..0ef8bc4 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -10878,7 +10878,7 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
* The "2" is there to mimic the native control. I think it may be
* related to either padding or edges. (GLA 7/2002)
*/
- if (!(infoPtr->dwStyle & WS_HSCROLL))
+ if (!(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_HSCROLL))
infoPtr->rcList.bottom -= GetSystemMetrics(SM_CYHSCROLL);
infoPtr->rcList.bottom = max (infoPtr->rcList.bottom - 2, 0);
}
--
1.7.5.4
More information about the wine-patches
mailing list