comctl32/listview: Don't query header if it isn't created.

This commit is contained in:
Nikolay Sivov 2009-10-22 00:29:00 +04:00 committed by Alexandre Julliard
parent 9f548bd9b8
commit aaec03347d
1 changed files with 15 additions and 11 deletions

View File

@ -10326,19 +10326,23 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
} }
else if (infoPtr->uView == LV_VIEW_DETAILS) else if (infoPtr->uView == LV_VIEW_DETAILS)
{ {
HDLAYOUT hl; /* if control created invisible header isn't created */
WINDOWPOS wp; if (infoPtr->hwndHeader)
{
HDLAYOUT hl;
WINDOWPOS wp;
hl.prc = &infoPtr->rcList; hl.prc = &infoPtr->rcList;
hl.pwpos = ℘ hl.pwpos = ℘
SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl ); SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl );
TRACE(" wp.flags=0x%08x, wp=%d,%d (%dx%d)\n", wp.flags, wp.x, wp.y, wp.cx, wp.cy); TRACE(" wp.flags=0x%08x, wp=%d,%d (%dx%d)\n", wp.flags, wp.x, wp.y, wp.cx, wp.cy);
SetWindowPos(wp.hwnd, wp.hwndInsertAfter, wp.x, wp.y, wp.cx, wp.cy, SetWindowPos(wp.hwnd, wp.hwndInsertAfter, wp.x, wp.y, wp.cx, wp.cy,
wp.flags | ((infoPtr->dwStyle & LVS_NOCOLUMNHEADER) wp.flags | ((infoPtr->dwStyle & LVS_NOCOLUMNHEADER)
? SWP_HIDEWINDOW : SWP_SHOWWINDOW)); ? SWP_HIDEWINDOW : SWP_SHOWWINDOW));
TRACE(" after SWP wp=%d,%d (%dx%d)\n", wp.x, wp.y, wp.cx, wp.cy); TRACE(" after SWP wp=%d,%d (%dx%d)\n", wp.x, wp.y, wp.cx, wp.cy);
infoPtr->rcList.top = max(wp.cy, 0); infoPtr->rcList.top = max(wp.cy, 0);
}
infoPtr->rcList.top += (infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) ? 2 : 0; infoPtr->rcList.top += (infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) ? 2 : 0;
} }