Commit 9cc12d28 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent ac8257cb
......@@ -7268,7 +7268,12 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM
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)
dwStyle |= HDS_DRAGDROP;
else
......
......@@ -965,6 +965,17 @@ static void test_create(void)
/* HDS_DRAGDROP set by default */
ok(GetWindowLongPtr(hHeader, GWL_STYLE) & HDS_DRAGDROP, "Expected header to have HDS_DRAGDROP\n");
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment