Function Reference


_GUICtrlListView_SetItemParam

Sets the value specific to the item

#include <GuiListView.au3>
_GUICtrlListView_SetItemParam ( $hWnd, $iIndex, $iParam )

Parameters

$hWnd Handle to the control
$iIndex 0-based index of the item
$iParam A value to associate with the item

Return Value

Success: True.
Failure: False.

Remarks

As AutoIt uses the $iParam parameter to store the controlID of native-created ListView items, this value should be set sufficiently high for UDF-created items to avoid possible conflict with any existing controls - a starting value of 1000 is recommended.

Related

_GUICtrlListView_GetItemParam

Example

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

Example()

Func Example()
    Local $idListview

    GUICreate("ListView Set Item Param", 400, 300)
    $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
    GUISetState(@SW_SHOW)

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

    ; Add items
    _GUICtrlListView_AddItem($idListview, "Item 1")
    _GUICtrlListView_AddItem($idListview, "Item 2")
    _GUICtrlListView_AddItem($idListview, "Item 3")

    ; Set item 2 parameter
    _GUICtrlListView_SetItemParam($idListview, 1, 1234)
    MsgBox($MB_SYSTEMMODAL, "Information", "Item 2 Parameter: " & _GUICtrlListView_GetItemParam($idListview, 1))

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example