Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic


Sets the spacing between icons in list-view controls that have the LVS_ICON style. You can send this message explicitly or by using the ListView_SetIconSpacing macro.



Must be zero.


The LOWORD specifies the distance, in pixels, to set between icons on the x-axis. The HIWORD specifies the distance, in pixels, to set between icons on the y-axis. See Remarks.

Return value

Returns a DWORD value that contains the previous x-axis distance in the low word, and the previous y-axis distance in the high word.


Values for lParam are relative to the upper-left corner of an icon bitmap. Therefore, to set spacing between icons that do not overlap, the lParam values must include the size of the icon, plus the amount of empty space desired between icons. Values that do not include the width of the icon will result in overlaps.

When defining the icon spacing, the lParam values must set to 4 or larger. Smaller values will not yield the desired layout. To reset the icons to the default spacing, set the lParam values to -1.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]





Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.