diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index a65d8321ab1..36e7b7e043e 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -9727,7 +9727,7 @@ static LRESULT LISTVIEW_NotifyFormat(LISTVIEW_INFO *infoPtr, HWND hwndFrom, INT /*** * DESCRIPTION: - * Paints/Repaints the listview control. + * Paints/Repaints the listview control. Internal use. * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure @@ -9766,6 +9766,25 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc) return 0; } +/*** + * DESCRIPTION: + * Paints/Repaints the listview control, WM_PAINT handler. + * + * PARAMETER(S): + * [I] infoPtr : valid pointer to the listview structure + * [I] hdc : device context handle + * + * RETURN: + * Zero + */ +static inline LRESULT LISTVIEW_WMPaint(LISTVIEW_INFO *infoPtr, HDC hdc) +{ + TRACE("(hdc=%p)\n", hdc); + + if (!is_redrawing(infoPtr)) return 0; + + return LISTVIEW_Paint(infoPtr, hdc); +} /*** * DESCRIPTION: @@ -10802,7 +10821,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return LISTVIEW_PrintClient(infoPtr, (HDC)wParam, (DWORD)lParam); case WM_PAINT: - return LISTVIEW_Paint(infoPtr, (HDC)wParam); + return LISTVIEW_WMPaint(infoPtr, (HDC)wParam); case WM_RBUTTONDBLCLK: return LISTVIEW_RButtonDblClk(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 516445c78bc..fb90196cf60 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -2834,7 +2834,7 @@ static void test_setredraw(void) InvalidateRect(hwnd, NULL, TRUE); UpdateWindow(hwnd); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, - "redraw after WM_SETREDRAW (FALSE)", TRUE); + "redraw after WM_SETREDRAW (FALSE)", FALSE); ret = SendMessage(hwnd, LVM_SETBKCOLOR, 0, CLR_NONE); expect(TRUE, ret); @@ -2842,7 +2842,7 @@ static void test_setredraw(void) InvalidateRect(hwnd, NULL, TRUE); UpdateWindow(hwnd); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, - "redraw after WM_SETREDRAW (FALSE) with CLR_NONE bkgnd", TRUE); + "redraw after WM_SETREDRAW (FALSE) with CLR_NONE bkgnd", FALSE); /* message isn't forwarded to header */ subclass_header(hwnd);