Guy Albertelli : comctl32: listview: Implement LVS_NOCOLUMNHEADER support for WM_STYLECHANGED message.
Alexandre Julliard
julliard at winehq.org
Wed Jun 25 16:43:59 CDT 2008
Module: wine
Branch: master
Commit: 6de37643396de6d21e3483c7289fa2d8104fac5c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6de37643396de6d21e3483c7289fa2d8104fac5c
Author: Guy Albertelli <galberte at neo.rr.com>
Date: Tue Jun 24 23:01:30 2008 -0400
comctl32: listview: Implement LVS_NOCOLUMNHEADER support for WM_STYLECHANGED message.
When switching LVS_NOCOLUMNHEADER on/off change the style of the header control HDS_HIDDEN.
---
dlls/comctl32/listview.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 6596ea2..6b16a7b 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -9420,6 +9420,7 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
{
UINT uNewView = lpss->styleNew & LVS_TYPEMASK;
UINT uOldView = lpss->styleOld & LVS_TYPEMASK;
+ UINT style;
TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n",
wStyleType, lpss->styleOld, lpss->styleNew);
@@ -9481,8 +9482,26 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
}
if (uNewView == LVS_REPORT)
- ShowWindow(infoPtr->hwndHeader, (lpss->styleNew & LVS_NOCOLUMNHEADER) ? SW_HIDE : SW_SHOWNORMAL);
-
+ {
+ if ((lpss->styleOld ^ lpss->styleNew) & LVS_NOCOLUMNHEADER)
+ {
+ if (lpss->styleNew & LVS_NOCOLUMNHEADER)
+ {
+ /* Turn off the header control */
+ style = GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE);
+ TRACE("Hide header control, was 0x%08x\n", style);
+ SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, style | HDS_HIDDEN);
+ } else {
+ /* Turn on the header control */
+ if ((style = GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE)) & HDS_HIDDEN)
+ {
+ TRACE("Show header control, was 0x%08x\n", style);
+ SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, (style & ~HDS_HIDDEN) | WS_VISIBLE);
+ }
+ }
+ }
+ }
+
if ( (uNewView == LVS_ICON || uNewView == LVS_SMALLICON) &&
(uNewView != uOldView || ((lpss->styleNew ^ lpss->styleOld) & LVS_ALIGNMASK)) )
LISTVIEW_Arrange(infoPtr, LVA_DEFAULT);
More information about the wine-cvs
mailing list