Function Reference


_GUICtrlListView_GetSelectionMark

Retrieves the selection mark from the control

#include <GuiListView.au3>
_GUICtrlListView_GetSelectionMark ( $hWnd )

Parameters

$hWnd Control ID/Handle to the control

Return Value

Success: the 0-based selection mark.
Failure: -1.

Remarks

The selection mark is the item index from which a multiple selection starts.

Related

_GUICtrlListView_SetSelectionMark

Example

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

Example()

Func Example()
        GUICreate("ListView Get/Set Selection Mark (v" & @AutoItVersion & ")", 400, 300)
        Local $idListview = GUICtrlCreateListView("", 2, 2, 394, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT))
        GUISetState(@SW_SHOW)

        ; Add columns
        _GUICtrlListView_AddColumn($idListview, "Column 0", 100)

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

        ; Select item 1
        _GUICtrlListView_SetSelectionMark($idListview, 1)
        MsgBox($MB_SYSTEMMODAL, "Information", "Selected Mark: " & _GUICtrlListView_GetSelectionMark($idListview))

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