Код:
Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
Local $tNMHDR, $iIDFrom, $iCode
Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
Local $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
Local $iCode = DllStructGetData($tNMHDR, "Code")
Switch $iIDFrom
Case $ListView_TEST ; It is our ListView
Switch $iCode
Case $NM_CUSTOMDRAW
Local $tNMLVCUSTOMDRAW = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam)
Local $dwDrawStage = DllStructGetData($tNMLVCUSTOMDRAW, "dwDrawStage")
Switch $dwDrawStage
Case $CDDS_PREPAINT ; Before the paint cycle begins
Return $CDRF_NOTIFYITEMDRAW
Case $CDDS_ITEMPREPAINT ; Before painting an item
Return $CDRF_NOTIFYSUBITEMDRAW ; Notify the parent window of any SUBITEM-related drawing operations
Case BitOR($CDDS_ITEMPREPAINT, $CDDS_SUBITEM) ; Before painting a subitem
Local $iIndex = DllStructGetData($tNMLVCUSTOMDRAW, "dwItemSpec")
If _GUICtrlListView_GetItemChecked($ListView_TEST, $iIndex) Then
DllStructSetData($tNMLVCUSTOMDRAW, "ClrText", 0xFF00FF)
Else
DllStructSetData($tNMLVCUSTOMDRAW, "ClrText", 0xFF0000)
EndIf
EndSwitch
EndSwitch
EndSwitch
EndFunc