# Function Reference

# _GUICtrlListView_GetItem

Retrieves an item's attributes

#include <GuiListView.au3>
_GUICtrlListView_GetItem ( $hWnd, $iIndex [, $iSubItem = 0] )

## Parameters

$hWnd | Control ID/Handle to the control
$iIndex | 0-based item index
$iSubItem | [optional] 1-based subitem index

## Return Value

Returns an array with the following format:
[0] - Item state, which can be a combination of the following:
1 - The item is marked for a cut-and-paste operation
2 - The item is highlighted as a drag-and-drop target
4 - The item has the focus
8 - The item is selected
[1] - 1-based item image overlay index
[2] - 1-based item state image index
[3] - Item text
[4] - 0-based item image index
[5] - Item application defined value
[6] - Number of image widths to indent the item
[7] - Identifier of the tile view group that receives the item

## Related

_GUICtrlListView_GetItemEx, _GUICtrlListView_SetItem

## Example

    #include <GUIConstantsEx.au3>
    #include <GuiListView.au3>
    #include <MsgBoxConstants.au3>

    Example()

    Func Example()
        Local $aItem, $idListview

        GUICreate("ListView Get/Set Item (v" & @AutoItVersion & ")", 400, 300)

        $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
        GUISetState(@SW_SHOW)

        ; Add column
        _GUICtrlListView_AddColumn($idListview, "Items", 100)

        ; Add items
        GUICtrlCreateListViewItem("Row 0", $idListview)
        GUICtrlCreateListViewItem("Row 1", $idListview)
        GUICtrlCreateListViewItem("Row 2", $idListview)

        ; Show item 1 text
        $aItem = _GUICtrlListView_GetItem($idListview, 1)
        MsgBox($MB_SYSTEMMODAL, "Information", "Item 1 Text: " & $aItem[3])

        ; Change item 1
        MsgBox($MB_SYSTEMMODAL, "Information", "Changing item 1")
        _GUICtrlListView_SetItem($idListview, "New Item 1", 1)

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE

        GUIDelete()
    EndFunc   ;==>Example