diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index d6703703406..427fb76f629 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -665,6 +665,8 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts) TRACE("(%d,%p)\n", count, parts); + if(!count) return FALSE; + oldNumParts = infoPtr->numParts; infoPtr->numParts = count; if (oldNumParts > infoPtr->numParts) { diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c index c46b6145cfd..85096744028 100644 --- a/dlls/comctl32/tests/status.c +++ b/dlls/comctl32/tests/status.c @@ -382,6 +382,12 @@ static void test_status_control(void) /* Reset number of parts */ r = SendMessage(hWndStatus, SB_SETPARTS, 2, (LPARAM)nParts); expect(TRUE,r); + r = SendMessage(hWndStatus, SB_GETPARTS, 0, 0); + ok(r == 2, "Expected 2, got %d\n", r); + r = SendMessage(hWndStatus, SB_SETPARTS, 0, 0); + expect(FALSE,r); + r = SendMessage(hWndStatus, SB_GETPARTS, 0, 0); + ok(r == 2, "Expected 2, got %d\n", r); /* Set the minimum height and get rectangle information again */ SendMessage(hWndStatus, SB_SETMINHEIGHT, 50, 0);