diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index e7435310801..26a9eb2a3e9 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -8972,11 +8972,10 @@ static LRESULT LISTVIEW_NotifyFormat(LISTVIEW_INFO *infoPtr, HWND hwndFrom, INT { TRACE("(hwndFrom=%p, nCommand=%d)\n", hwndFrom, nCommand); - if (nCommand != NF_REQUERY) return 0; - - infoPtr->notifyFormat = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY); - - return 0; + if (nCommand == NF_REQUERY) + infoPtr->notifyFormat = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY); + + return infoPtr->notifyFormat; } /*** diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 838691c9fd7..91f9d00c8d4 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -856,6 +856,9 @@ static void test_icon_spacing(void) hwnd = create_custom_listview_control(LVS_ICON); ok(hwnd != NULL, "failed to create a listview window\n"); + r = SendMessage(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwndparent, (LPARAM)NF_REQUERY); + expect(NFR_ANSI, r); + flush_sequences(sequences, NUM_MSG_SEQUENCES); trace("test icon spacing\n");