From 6de37643396de6d21e3483c7289fa2d8104fac5c Mon Sep 17 00:00:00 2001 From: Guy Albertelli Date: Tue, 24 Jun 2008 23:01:30 -0400 Subject: [PATCH] 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 file changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 6596ea2d776..6b16a7bbab7 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); -- 2.11.4.GIT