Help Center

CListView.AddItemmethod

Inserts a new item in a list-view control.

WindowsmethodCListView.incdocumented

Syntax

FUNCTION AddItem (BYVAL hListView AS HWND, BYVAL iItem AS LONG, BYVAL iImage AS LONG, BYREF wszText AS WSTRING) AS LONG

Parameters

NameDescription
hListViewHandle to the ListView control.
iItemIndex at which the new item should be inserted. If this value is greater than the number of items currently contained by the listview control, the new item will be appended to the end of the list and assigned the correct index. Examine the return value to determine the actual index assigned to the item.
iImageIndex of the item's icon in the control's image list.
wszTextThe item text.

Return value

Returns the index of the new item if successful, or -1 otherwise.

Description

Inserts a new item in a list-view control.

Reference

  • Include file CListView.inc
  • Defined in AfxNova/CListView.inc:1298
  • Documented in Windows/WIndows Controls/CListView Class.md
  • Topic: CListView Class