ListView_SetItemPosition macro (commctrl.h)

Moves an item to a specified position in a list-view control (in icon or small icon view). You can use this macro or send the LVM_SETITEMPOSITION message explicitly.

Syntax

BOOL ListView_SetItemPosition(
   HWND hwndLV,
   int  i,
   int  x,
   int  y
);

Parameters

hwndLV

Type: HWND

A handle to the list-view control.

i

Type: int

The index of the list-view item.

x

Type: int

The new x-position of the item's upper-left corner, in view coordinates.

y

Type: int

The new y-position of the item's upper-left corner, in view coordinates.

Return value

Type: BOOL

Returns TRUE if successful, or FALSE otherwise.

Remarks

If the list-view control has the LVS_AUTOARRANGE style, the list-view control is arranged after the position of the item is set.

On Windows Vista, calling this macro on a list-view control with the LVS_AUTOARRANGE style does nothing, and the return value is FALSE.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header commctrl.h