comctl32/listview: Header should be created when LVS_EX_HEADERDRAGDROP set.

This commit is contained in:
Nikolay Sivov 2009-04-21 05:29:22 -04:00 committed by Alexandre Julliard
parent ac8257cb1e
commit 9cc12d2879
2 changed files with 17 additions and 1 deletions

View File

@ -7268,7 +7268,12 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM
if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_HEADERDRAGDROP) if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_HEADERDRAGDROP)
{ {
DWORD dwStyle = GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE); DWORD dwStyle;
/* if not already created */
LISTVIEW_CreateHeader(infoPtr);
dwStyle = GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE);
if (infoPtr->dwLvExStyle & LVS_EX_HEADERDRAGDROP) if (infoPtr->dwLvExStyle & LVS_EX_HEADERDRAGDROP)
dwStyle |= HDS_DRAGDROP; dwStyle |= HDS_DRAGDROP;
else else

View File

@ -965,6 +965,17 @@ static void test_create(void)
/* HDS_DRAGDROP set by default */ /* HDS_DRAGDROP set by default */
ok(GetWindowLongPtr(hHeader, GWL_STYLE) & HDS_DRAGDROP, "Expected header to have HDS_DRAGDROP\n"); ok(GetWindowLongPtr(hHeader, GWL_STYLE) & HDS_DRAGDROP, "Expected header to have HDS_DRAGDROP\n");
DestroyWindow(hList); DestroyWindow(hList);
/* setting LVS_EX_HEADERDRAGDROP creates header */
hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL,
GetModuleHandle(NULL), 0);
ok(!IsWindow(hHeader), "Header shouldn't be created\n");
ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n");
SendMessage(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_HEADERDRAGDROP);
hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0);
ok(IsWindow(hHeader), "Header should be created\n");
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
DestroyWindow(hList);
} }
static void test_redraw(void) static void test_redraw(void)