Структура LV_ITEM

Type LV_ITEM
    mask As Long
    iItem As Long
    iSubItem As Long
    State As Long
    stateMask As Long
    pszText As Long
    cchTextMax As Long
    iImage As Long
    lParam As Long
    iIndent As Long
End Type

Структура LV_ITEM задает или получает атрибуты элементов ListView.

Состав структуры

mask
Флаги, определяющие какое поле структуры содержит данные для установки или какое поле структуры ожидает запроса. Может принимать следующие значения
LVIF_COLFMTWindows Vista и выше: поле piColFmt доступно для применения. Если этот флаг используется, то поле cColumns тоже доступно
LVIF_COLUMNSПоле cColumns доступно
LVIF_DI_SETITEMОперационная система должна хранить информацию о запрошенном списке элементов и не запрашиваеть его снова. Данный флаг используется только с сообщением LVN_GETDISPINFO
LVIF_GROUPIDПоле iGroupId доступно. Если этот флаг не установлен, когда посылается сообщение LVM_INSERTITEM, то значение iGroupId передается в I_GROUPIDCALLBACK
LVIF_IMAGEПоле iImage доступно
LVIF_INDENTПоле iIndent доступно
LVIF_NORECOMPUTEЭлемент не генерирует LVN_GETDISPINFO для получения текстовой информации, если он получает сообщение LVM_GETITEM. Вместо этого, поле pszText будет содержать LPSTR_TEXTCALLBACK
LVIF_PARAMПоле lParam доступно
LVIF_STATEПоле state доступно
LVIF_TEXTПоле pszText доступно
iTem
Индекс элемента
iSubItem
Индекс подэлемента
state
Indicates the item's state, state image, and overlay image. The stateMask member indicates the valid bits of this member. Bits 0 through 7 of this member contain the item state flags. This can be one or more of the item state values. Bits 8 through 11 of this member specify the one-based overlay image index. Both the full-sized icon image list and the small icon image list can have overlay images. The overlay image is superimposed over the item's icon image. If these bits are zero, the item has no overlay image. To isolate these bits, use the LVIS_OVERLAYMASK mask. To set the overlay image index in this member, you should use the INDEXTOOVERLAYMASK macro. The image list's overlay images are set with the ImageList_SetOverlayImage function. Bits 12 through 15 of this member specify the state image index. The state image is displayed next to an item's icon to indicate an application-defined state. If these bits are zero, the item has no state image. To isolate these bits, use the LVIS_STATEIMAGEMASK mask. To set the state image index, use the INDEXTOSTATEIMAGEMASK macro. The state image index specifies the index of the image in the state image list that should be drawn. The state image list is specified with the LVM_SETIMAGELIST message
stateMaskn
Value specifying which bits of the state member will be retrieved or modified. For example, setting this member to LVIS_SELECTED will cause only the item's selection state to be retrieved. This member allows you to modify one or more item states without having to retrieve all of the item states first. For example, setting this member to LVIS_SELECTED and state to zero will cause the item's selection state to be cleared, but none of the other states will be affected. To retrieve or modify all of the states, set this member to (UINT)-1.
pszText
If the structure specifies item attributes, pszText is a pointer to a null-terminated string containing the item text. When responding to an LVN_GETDISPINFO notification, be sure that this pointer remains valid until after the next notification has been received. If the structure receives item attributes, pszText is a pointer to a buffer that receives the item text. Note that although the list-view control allows any length string to be stored as item text, only the first 260 TCHARs are displayed. If the value of pszText is LPSTR_TEXTCALLBACK, the item is a callback item. If the callback text changes, you must explicitly set pszText to LPSTR_TEXTCALLBACK and notify the list-view control of the change by sending an LVM_SETITEM or LVM_SETITEMTEXT message. Do not set pszText to LPSTR_TEXTCALLBACK if the list-view control has the LVS_SORTASCENDING or LVS_SORTDESCENDING style.
cchTextMax
Number of TCHARs in the buffer pointed to by pszText, including the terminating NULL. This member is only used when the structure receives item attributes. It is ignored when the structure specifies item attributes. For example, cchTextMax is ignored during LVM_SETITEM and LVM_INSERTITEM. It is read-only during LVN_GETDISPINFO and other LVN_ notifications. Note Never copy more than cchTextMax TCHARs—where cchTextMax includes the terminating NULL—into pszText during an LVN_ notification, otherwise your program can fail.
iImage
Index of the item's icon in the control's image list. This applies to both the large and small image list. If this member is the I_IMAGECALLBACK value, the parent window is responsible for storing the index. In this case, the list-view control sends the parent an LVN_GETDISPINFO notification message to retrieve the index when it needs to display the image
Param
Value specific to the item. If you use the LVM_SORTITEMS message, the list-view control passes this value to the application-defined comparison function. You can also use the LVM_FINDITEM message to search a list-view control for an item with a specified lParam value
iIndent
Number of image widths to indent the item. A single indentation equals the width of an item image. Therefore, the value 1 indents the item by the width of one image, the value 2 indents by two images, and so on. Note that this field is supported only for items. Attempting to set subitem indentation will cause the calling function to fail.

Используется в

LVM_GETITEMTEX