voila une fonction qui manque dans l'UDF: GuiListView.au3.
Permet de retrouver les indices d'une listview avec checkbox des Items coché, dans le même principe que _GUICtrlListView_GetSelectedIndices.
Elle retourne au choix une chaine de carractères "indice 1|indice 2|...|indice n" ou un tableau:
1d (array)
[0]=5 nb de case coché
[1]=12 indice 1
[2]=3 indice 2
...
[n]=5 indice n
; #FUNCTION# ====================================================================================================================
; Name...........: _GUICtrlListView_GetCheckedIndices
; Description ...: Retrieve indices of Checked item(s)
; Syntax.........: _GUICtrlListView_GetCheckedIndices($hWnd, $fArray = False)
; Parameters ....: $hWnd - Handle to the control
; $fArray - Return string or Array
; |True - Returns array
; |False - Returns pipe "|" delimited string
; Return values .: Success - Selected indices Based on $fArray:
; +Array - With the following format
; |[0] - Number of Items in array (n)
; |[1] - First item index
; |[2] - Second item index
; |[n] - Last item index
; |String - With the following format
; |"0|1|2|n"
; Failure - Based on $fArray
; |Array - With the following format
; |[0] - Number of Items in array (0)
; |String - Empty ("")
; Author ........: Gary delaMer
; Modified.......:
; Remarks .......:
; Related .......: _GUICtrlListView_GetSelectedIndices
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _GUICtrlListView_GetCheckedIndices($hWnd, $bArray = False)
If $Debug_LV Then __UDF_ValidateClassName($hWnd, $__LISTVIEWCONSTANT_ClassName)
Local $i = 0, $iCount = _GUICtrlListView_GetItemCount($hWnd)
Local $sIndices, $aIndices[$iCount + 1] = [0]
For $iItem = 0 To $iCount
If _GUICtrlListView_GetItemChecked($hWnd, $iItem) Then
If (Not $bArray) Then
If StringLen($sIndices) Then
$sIndices &= "|" & $iItem
Else
$sIndices = $iItem
EndIf
Else
$i += 1
$aIndices[$i] = $iItem
EndIf
EndIf
Next
If (Not $bArray) Then
Return String($sIndices)
Else
$aIndices[0] = $i
ReDim $aIndices[$i + 1]
Return $aIndices
EndIf
EndFunc ;==>_GUICtrlListView_GetCheckedIndices