Das würde dann so gehen:
AutoIt Alles anzeigen#include <Array.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #NoTrayIcon #Region ### START Koda GUI section ### Form=C:\Users\Julian\Desktop\AutoIT\koda_1.7.3.0\Forms\crashcheckersettings.kxf Global $Form1 = GUICreate("test", 400, 600) GUISetFont(12, 400, 0, "Arial") Global $Label1 = GUICtrlCreateLabel("Wähle die zu überwachenden Prozesse jetzt aus. ", 10, 5, 380, 27) GUICtrlSetFont(-1, 12, 400, 2, "Arial") Global $idList = GUICtrlCreateListView('Prozess|PID', 10, 40, 380, 520, Default, BitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES)) Global $hList = GUICtrlGetHandle($idList) _GUICtrlListView_JustifyColumn($hList, 1, 1) $idGetChecked = GUICtrlCreateButton('Auswahl anzeigen', 120, 570, 150, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $aProcesslist = ProcessList() _ArrayDelete($aProcesslist, 0) ; den Zähler aus dem Array rauswerfen _ArraySort($aProcesslist) ; Array sortieren _GUICtrlListView_AddArray($hList, $aProcesslist) _GUICtrlListView_SetColumnWidth($hList, 0, $LVSCW_AUTOSIZE) _GUICtrlListView_SetColumnWidth($hList, 1, $LVSCW_AUTOSIZE) Global $aCheckedProcess While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idGetChecked $aCheckedProcess = _GUICtrlListView_GetCheckedItemText($hList) If Not @error Then _ArrayDisplay($aCheckedProcess, 'ausgewählte Prozesse') EndSwitch WEnd Func _GUICtrlListView_GetCheckedItemText($hListView, $iSubItem = 0) Local $aCheckedIndices = _GUICtrlListView_GetCheckedIndices($hListView) If @error Then Return SetError(@error, 0, 0) Local $aCheckedItemText[UBound($aCheckedIndices)] For $i = 0 To UBound($aCheckedIndices) - 1 $aCheckedItemText[$i] = _GUICtrlListView_GetItemText($hList, $aCheckedIndices[$i], $iSubItem) Next Return $aCheckedItemText EndFunc ;==>_GUICtrlListView_GetCheckedItemText Func _GUICtrlListView_GetCheckedIndices($hListView) Local $iCount = _GUICtrlListView_GetItemCount($hListView), $sChecked = '' If $iCount = 0 Then Return SetError(1, 0, 0) For $i = 0 To $iCount - 1 If _GUICtrlListView_GetItemChecked($hListView, $i) Then $sChecked &= $i & ',' Next If $sChecked = '' Then Return SetError(2, 0, 0) Return StringSplit(StringTrimRight($sChecked, 1), ',', 2) EndFunc ;==>_GUICtrlListView_GetCheckedIndices
Danke!