comctl32/listview: Pass WM_NCCREATE down to default procedure.
Problem analyzed by Vadim Druzhin <cdslow@mail.ru>. Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b91fdc7700
commit
ee7ddd1ed3
|
@ -9473,7 +9473,7 @@ static VOID CALLBACK LISTVIEW_DelayedEditItem(HWND hwnd, UINT uMsg, UINT_PTR idE
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
|
static LRESULT LISTVIEW_NCCreate(HWND hwnd, WPARAM wParam, const CREATESTRUCTW *lpcs)
|
||||||
{
|
{
|
||||||
LISTVIEW_INFO *infoPtr;
|
LISTVIEW_INFO *infoPtr;
|
||||||
LOGFONTW logFont;
|
LOGFONTW logFont;
|
||||||
|
@ -9532,7 +9532,8 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||||
if (!(infoPtr->hdpaPosX = DPA_Create(10))) goto fail;
|
if (!(infoPtr->hdpaPosX = DPA_Create(10))) goto fail;
|
||||||
if (!(infoPtr->hdpaPosY = DPA_Create(10))) goto fail;
|
if (!(infoPtr->hdpaPosY = DPA_Create(10))) goto fail;
|
||||||
if (!(infoPtr->hdpaColumns = DPA_Create(10))) goto fail;
|
if (!(infoPtr->hdpaColumns = DPA_Create(10))) goto fail;
|
||||||
return TRUE;
|
|
||||||
|
return DefWindowProcW(hwnd, WM_NCCREATE, wParam, (LPARAM)lpcs);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
DestroyWindow(infoPtr->hwndHeader);
|
DestroyWindow(infoPtr->hwndHeader);
|
||||||
|
@ -11691,7 +11692,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
return LISTVIEW_Command(infoPtr, wParam, lParam);
|
return LISTVIEW_Command(infoPtr, wParam, lParam);
|
||||||
|
|
||||||
case WM_NCCREATE:
|
case WM_NCCREATE:
|
||||||
return LISTVIEW_NCCreate(hwnd, (LPCREATESTRUCTW)lParam);
|
return LISTVIEW_NCCreate(hwnd, wParam, (LPCREATESTRUCTW)lParam);
|
||||||
|
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
return LISTVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam);
|
return LISTVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam);
|
||||||
|
|
|
@ -1523,6 +1523,8 @@ static LRESULT CALLBACK create_test_wndproc(HWND hwnd, UINT uMsg, WPARAM wParam,
|
||||||
|
|
||||||
static void test_create(void)
|
static void test_create(void)
|
||||||
{
|
{
|
||||||
|
static const WCHAR testtextW[] = {'t','e','s','t',' ','t','e','x','t',0};
|
||||||
|
char buff[16];
|
||||||
HWND hList;
|
HWND hList;
|
||||||
HWND hHeader;
|
HWND hHeader;
|
||||||
LONG_PTR ret;
|
LONG_PTR ret;
|
||||||
|
@ -1734,6 +1736,23 @@ static void test_create(void)
|
||||||
ok_sequence(sequences, PARENT_SEQ_INDEX, create_ownerdrawfixed_parent_seq,
|
ok_sequence(sequences, PARENT_SEQ_INDEX, create_ownerdrawfixed_parent_seq,
|
||||||
"created with LVS_OWNERDRAWFIXED|LVS_REPORT - parent seq", FALSE);
|
"created with LVS_OWNERDRAWFIXED|LVS_REPORT - parent seq", FALSE);
|
||||||
DestroyWindow(hList);
|
DestroyWindow(hList);
|
||||||
|
|
||||||
|
/* Test that window text is preserved. */
|
||||||
|
hList = CreateWindowExA(0, WC_LISTVIEWA, "test text", WS_CHILD | WS_BORDER | WS_VISIBLE,
|
||||||
|
0, 0, 100, 100, hwndparent, NULL, GetModuleHandleA(NULL), NULL);
|
||||||
|
ok(hList != NULL, "Failed to create ListView window.\n");
|
||||||
|
*buff = 0;
|
||||||
|
GetWindowTextA(hList, buff, sizeof(buff));
|
||||||
|
ok(!strcmp(buff, "test text"), "Unexpected window text %s.\n", buff);
|
||||||
|
DestroyWindow(hList);
|
||||||
|
|
||||||
|
hList = CreateWindowExW(0, WC_LISTVIEWW, testtextW, WS_CHILD | WS_BORDER | WS_VISIBLE,
|
||||||
|
0, 0, 100, 100, hwndparent, NULL, GetModuleHandleA(NULL), NULL);
|
||||||
|
ok(hList != NULL, "Failed to create ListView window.\n");
|
||||||
|
*buff = 0;
|
||||||
|
GetWindowTextA(hList, buff, sizeof(buff));
|
||||||
|
ok(!strcmp(buff, "test text"), "Unexpected window text %s.\n", buff);
|
||||||
|
DestroyWindow(hList);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_redraw(void)
|
static void test_redraw(void)
|
||||||
|
|
Loading…
Reference in New Issue