diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index ab9cefe..4e341f7 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -9372,16 +9372,21 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
     {
 	HDLAYOUT hl;
 	WINDOWPOS wp;
+        int ok;
 
 	hl.prc = &infoPtr->rcList;
 	hl.pwpos = &wp;
-	SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl );
-        TRACE("  wp.flags=0x%08x, wp=%d,%d (%dx%d)\n", wp.flags, wp.x, wp.y, wp.cx, wp.cy);
-	SetWindowPos(wp.hwnd, wp.hwndInsertAfter, wp.x, wp.y, wp.cx, wp.cy, wp.flags);
-        TRACE("  after SWP wp=%d,%d (%dx%d)\n", wp.x, wp.y, wp.cx, wp.cy);
-
-	infoPtr->rcList.top = max(wp.cy, 0);
-        infoPtr->rcList.top += (infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) ? 2 : 0;
+	ok = SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl );
+        TRACE("  ok %d, wp.flags=0x%08x, wp=%d,%d (%dx%d)\n", ok, wp.flags, wp.x, wp.y, wp.cx, wp.cy);
+        if (ok) {
+	    SetWindowPos(wp.hwnd, wp.hwndInsertAfter, wp.x, wp.y, wp.cx, wp.cy, wp.flags);
+            TRACE("  after SWP wp=%d,%d (%dx%d)\n", wp.x, wp.y, wp.cx, wp.cy);
+
+	    infoPtr->rcList.top = max(wp.cy, 0);
+            infoPtr->rcList.top += (infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) ? 2 : 0;
+        } else {
+            WARN("HDM_LAYOUT failed\n");
+        }
     }
 
     TRACE("  rcList=%s\n", wine_dbgstr_rect(&infoPtr->rcList));

