Share via


LVM_SETITEMCOUNT (Compact 2013)

3/28/2014

This message prepares a list-view control for adding a large number of items. In a regular list-view control, it causes the control to allocate memory for the specified number of items. In a virtual list-view control, it sets the number of virtual items in the control. You can send this message explicitly or use the ListView_SetItemCount or ListView_SetItemCountEx macro.

Syntax

LVM_SETITEMCOUNT wParam = (WPARAM) (int) cItems; 
    lParam = (LPARAM) dwFlags;

Parameters

  • cItems
    Number of items that the list-view control will ultimately contain.
  • dwFlags
    This value specifies the behavior of the list-view control after resetting the item count. This value can be a combination of the following.

    Value

    Description

    LVSICF_NOINVALIDATEALL

    The list-view control will not repaint unless affected items are currently in view.

    LVSICF_NOSCROLL

    The list-view control will not change the scroll position when the item count changes.

Return Value

Nonzero indicates success. Zero indicates failure.

Remarks

You can create virtual list views using the LVS_OWNERDATA style. In a virtual list view, this function sets the number of items in the virtual list view, but does not allocate any memory.

The dwFlags parameter is intended only for list-view controls that use the LVS_OWNERDATA and either LVS_REPORT or LVS_LIST styles.

Related macro ListView_SetItemCount

Requirements

Header

commctrl.h

See Also

Reference

List-View Controls Messages
ListView_SetItemCount