On March 14, 2003 02:22 am, Vitaliy Margolen wrote: > - INT cy = HIWORD(spacing), cx = LOWORD(spacing); > + signed short int cy = HIWORD(spacing), cx = LOWORD(spacing); Good spotting! An alternative fix is to us SHIWORD() and SLOWORD() instead. But since we're here, the pattern is to decode this sort of thing directly in LISTVIEW_WindowProc(), so let's do just that: ChangeLog Spacing information is signed (debugged and fixed by Vitaliy Margolen). Decode spacing information in the window procedure. Some spelling fixes. Index: dlls/comctl32/listview.c =================================================================== RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v retrieving revision 1.343 diff -u -r1.343 listview.c --- dlls/comctl32/listview.c 7 Mar 2003 20:35:30 -0000 1.343 +++ dlls/comctl32/listview.c 14 Mar 2003 13:59:57 -0000 @@ -937,7 +937,7 @@ * - a special item to deal with * - simple range, or composite range * - empty range. - * If find bugs, or want to add features, please make sure you + * If you find bugs, or want to add features, please make sure you * always check/modify *both* iterator_prev, and iterator_next. */ @@ -1249,7 +1249,7 @@ return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE); } -/* Listview invlaidation functions: use _only_ these function to invalidate */ +/* Listview invalidation functions: use _only_ these functions to invalidate */ static inline BOOL is_redrawing(LISTVIEW_INFO *infoPtr) { @@ -6478,12 +6478,13 @@ * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure - * [I] spacing : MAKELONG(cx, cy) + * [I] cx : horizontal spacing (-1 = system spacing, 0 = autosize) + * [I] cy : vertical spacing (-1 = system spacing, 0 = autosize) * * RETURN: * MAKELONG(oldcx, oldcy) */ -static DWORD LISTVIEW_SetIconSpacing(LISTVIEW_INFO *infoPtr, DWORD spacing) +static DWORD LISTVIEW_SetIconSpacing(LISTVIEW_INFO *infoPtr, INT cx, INT cy) { INT cy = HIWORD(spacing), cx = LOWORD(spacing); DWORD oldspacing = MAKELONG(infoPtr->iconSpacing.cx, infoPtr->iconSpacing.cy); @@ -6567,7 +6568,7 @@ himlOld = infoPtr->himlNormal; infoPtr->himlNormal = himl; if (uView == LVS_ICON) set_icon_size(&infoPtr->iconSize, himl, FALSE); - LISTVIEW_SetIconSpacing(infoPtr, 0); + LISTVIEW_SetIconSpacing(infoPtr, 0, 0); break; case LVSIL_SMALL: @@ -8298,7 +8299,7 @@ { TRACE("icon old size=(%ld,%ld), new size=(%ld,%ld)\n", oldIconSize.cx, oldIconSize.cy, infoPtr->iconSize.cx, infoPtr->iconSize.cy); - LISTVIEW_SetIconSpacing(infoPtr, 0); + LISTVIEW_SetIconSpacing(infoPtr, 0, 0); } } else if (uNewView == LVS_REPORT) @@ -8620,7 +8621,7 @@ return LISTVIEW_SetHoverTime(infoPtr, (DWORD)wParam); case LVM_SETICONSPACING: - return LISTVIEW_SetIconSpacing(infoPtr, (DWORD)lParam); + return LISTVIEW_SetIconSpacing(infoPtr, SLOWORD(lParam), SHIWORD(lParam)); case LVM_SETIMAGELIST: return (LRESULT)LISTVIEW_SetImageList(infoPtr, (INT)wParam, (HIMAGELIST)lParam); -- Dimi.