Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This macro changes the text of a list-view item or subitem. You can use this macro or send the LVM_SETITEMTEXT message explicitly.

Syntax

void WINAPI ListView_SetItemText( 
  HWND 
hwnd, 
  int 
i, 
  int 
iSubItem, 
  LPCSTR 
pszText 
);

Parameters

hwnd

Handle to the list-view control.

i

Index of the list-view item.

iSubItem

Index of the subitem. To set the item label, set iSubItemto zero.

pszText

Pointer to a null-terminated string that contains the new text.

This parameter can be LPSTR_TEXTCALLBACK to indicate a callback item for which the parent window stores the text. In this case, the list-view control sends the parent an LVN_GETDISPINFO message when it needs the text.

This parameter can be NULL.

Return Value

None.

Remarks

Calls to ListView_SetItemText will fail if the control was created with the LVS_OWNERDATA control styles.

Related message:  LVM_SETITEMTEXT

Requirements

Header commctrl.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also