diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 1274d15cf83..a22b2da3a56 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -11468,7 +11468,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return LISTVIEW_SetHoverTime(infoPtr, (DWORD)lParam); case LVM_SETICONSPACING: - return LISTVIEW_SetIconSpacing(infoPtr, (short)LOWORD(lParam), (short)HIWORD(lParam)); + if(lParam == -1) + return LISTVIEW_SetIconSpacing(infoPtr, -1, -1); + return LISTVIEW_SetIconSpacing(infoPtr, LOWORD(lParam), HIWORD(lParam)); case LVM_SETIMAGELIST: return (LRESULT)LISTVIEW_SetImageList(infoPtr, (INT)wParam, (HIMAGELIST)lParam); diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 98ca4959407..fef3f607a79 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -4654,11 +4654,26 @@ static void test_getitemspacing(void) ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); expect(100, LOWORD(ret)); + expect(0xFFFF, HIWORD(ret)); - ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, -1); - expect(100, LOWORD(ret)); - expect(0xFFFF, HIWORD(ret)); + if (sizeof(void*) == 8) + { + /* NOTE: -1 is not treated the same as (DWORD)-1 by 64bit listview */ + ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, (DWORD)-1); + expect(100, LOWORD(ret)); + expect(0xFFFF, HIWORD(ret)); + + ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, -1); + expect(0xFFFF, LOWORD(ret)); + expect(0xFFFF, HIWORD(ret)); + } + else + { + ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, -1); + expect(100, LOWORD(ret)); + expect(0xFFFF, HIWORD(ret)); + } ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); /* spacing + icon size returned */ expect(cx + 40, LOWORD(ret));