From 9a3dd5b249314885309582e99f79e26834c85f5c Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Tue, 23 May 2000 01:24:24 +0000 Subject: [PATCH] If a listview is created with LVS_NOCOLUMNEHEADER then wine creates the header like normal but just sets it not visible. This fix lays out those supposedly nonexistent headers to size 0,0. So that even if they become visible they are not drawn. --- dlls/comctl32/listview.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index ba565020fa5..b2467f2ad38 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -6001,6 +6001,19 @@ static LRESULT LISTVIEW_Create(HWND hwnd, WPARAM wParam, LPARAM lParam) { ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL); } + else + { + /* resize our header to nothing */ + RECT zeroRect; + WINDOWPOS wp; + HDLAYOUT hd; + memset(&zeroRect,0,sizeof(RECT)); + hd.prc = &zeroRect; + hd.pwpos = ℘ + + Header_Layout(infoPtr->hwndHeader,&hd); + } + infoPtr->iconSize.cx = GetSystemMetrics(SM_CXSMICON); infoPtr->iconSize.cy = GetSystemMetrics(SM_CYSMICON); @@ -7166,7 +7179,7 @@ static VOID LISTVIEW_UpdateSize(HWND hwnd) } } } - else if (uView == LVS_REPORT) + else if ((uView == LVS_REPORT)&&(!(LVS_NOCOLUMNHEADER & lStyle))) { HDLAYOUT hl; WINDOWPOS wp; @@ -7241,15 +7254,25 @@ static INT LISTVIEW_StyleChanged(HWND hwnd, WPARAM wStyleType, HDLAYOUT hl; WINDOWPOS wp; - hl.prc = &rcList; - hl.pwpos = ℘ - Header_Layout(infoPtr->hwndHeader, &hl); - SetWindowPos(infoPtr->hwndHeader, hwnd, wp.x, wp.y, wp.cx, wp.cy, - wp.flags); if (!(LVS_NOCOLUMNHEADER & lpss->styleNew)) { + hl.prc = &rcList; + hl.pwpos = ℘ + Header_Layout(infoPtr->hwndHeader, &hl); + SetWindowPos(infoPtr->hwndHeader, hwnd, wp.x, wp.y, wp.cx, wp.cy, + wp.flags); ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL); } + else + { + RECT zeroRect; + ZeroMemory(&zeroRect,sizeof(RECT)); + + hl.prc = &zeroRect; + hl.pwpos = ℘ + Header_Layout(infoPtr->hwndHeader, &hl); + } + infoPtr->iconSize.cx = GetSystemMetrics(SM_CXSMICON); infoPtr->iconSize.cy = GetSystemMetrics(SM_CYSMICON); infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd);