1 out of 3 rated this helpful - Rate this topic

LVM_GETITEMTEXT message

Applies to: desktop apps only

Retrieves the text of a list-view item or subitem. You can send this message explicitly or by using the ListView_GetItemText macro.

Parameters

wParam

Index of the list-view item.

lParam

Pointer to an LVITEM structure. To retrieve the item text, set iSubItem to zero. To retrieve the text of a subitem, set iSubItem to the subitem's index. The pszText member points to a buffer that receives the text. The cchTextMax member specifies the number of characters in the buffer.

Return value

If you send this message explicitly, it returns the number of characters in the pszText member of the LVITEM structure.

Remarks

You can also send this message by calling the ListView_GetItemText macro. However, this macro does not return the string length.

LVM_GETITEMTEXT is not supported under the LVS_OWNERDATA style.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Commctrl.h

Unicode and ANSI names

LVM_GETITEMTEXTW (Unicode) and LVM_GETITEMTEXTA (ANSI)

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
No need to set the mask
The only purpose of the LVM_GETITEMTEXT message is to retrieve the item text. That's why the message itself sets the "mask" member of the given LVITEM structure to LVIF_TEXT.
What should be mask?
agreed with earlier commenter.. very sloppy documentation. what should be mask? LVIF_TEXT??
what if the buffer is not large enough?

will the text be truncated or what?

very sloppy documentation considerng that the listview contrl hs been arond for so many years.