Du kannst dir auch sicher eine Funktion daraus erstellen. Die ganze Zeile einfärben ist am einfachsten:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Form1", 195, 123, 339, 251)
$ListView1 = GUICtrlCreateListView("Server|Status", 8, 8, 177, 105)
GUICtrlSendMsg(-1, 0x101E, 0, 50)
GUICtrlSendMsg(-1, 0x101E, 1, 50)
$ListView1_0 = GUICtrlCreateListViewItem("Server1|online", $ListView1)
If StringInStr (GUICtrlRead($ListView1_0), 'offline') Then
GUICtrlSetBkColor(-1, 0xff0000)
Else
GUICtrlSetBkColor(-1, 0x00ff00)
EndIf
$ListView1_1 = GUICtrlCreateListViewItem("Server2|online", $ListView1)
If StringInStr (GUICtrlRead($ListView1_1), 'offline') Then
GUICtrlSetBkColor(-1, 0xff0000)
Else
GUICtrlSetBkColor(-1, 0x00ff00)
EndIf
$ListView1_2 = GUICtrlCreateListViewItem("Server3|offline", $ListView1)
If StringInStr (GUICtrlRead($ListView1_2), 'offline') Then
GUICtrlSetBkColor(-1, 0xff0000)
Else
GUICtrlSetBkColor(-1, 0x00ff00)
EndIf
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd