Buggy code:
int clrSelectionBk = - 1 ; boolean drawSelected = false ; boolean drawBackground = false ; if ( OS . IsWindowEnabled ( handle ) ) { if ( selected && ( ( ( nmcd . iSubItem ) == 0 ) || ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) ) ) { if ( ( OS . GetFocus ( ) ) == ( handle ) ) { drawSelected = true ; if ( explorerTheme ) { data . foreground = ( clrText != ( - 1 ) ) ? clrText : getForegroundPixel ( ) ; } else { data . foreground = OS . GetSysColor ( COLOR_HIGHLIGHTTEXT ) ; } data . background = clrSelectionBk = OS . GetSysColor ( COLOR_HIGHLIGHT ) ; } else { drawSelected = ( ( style ) & ( SWT . HIDE_SELECTION ) ) == 0 ; data . foreground = OS . GetTextColor ( hDC ) ; data . background = clrSelectionBk = OS . GetSysColor ( COLOR_3DFACE ) ; } } else { drawBackground = clrTextBk != ( - 1 ) ; if ( clrTextBk == ( - 1 ) ) { Control control = findBackgroundControl ( ) ; if ( control == null ) control = this ; clrTextBk = control . getBackgroundPixel ( ) ; } data . foreground = ( clrText != ( - 1 ) ) ? clrText : OS . GetTextColor ( hDC ) ; data . background = ( clrTextBk != ( - 1 ) ) ? clrTextBk : OS . GetBkColor ( hDC ) ; } } else { data . foreground = OS . GetSysColor ( COLOR_GRAYTEXT ) ; data . background = OS . GetSysColor ( COLOR_3DFACE ) ; if ( selected ) clrSelectionBk = data . background ; } data . hPen = OS . CreatePen ( PS_SOLID , 0 , data . foreground ) ; data . hBrush = OS . CreateSolidBrush ( data . background ) ; data . hFont = hFont ; int nSavedDC = OS . SaveDC ( hDC ) ; GC gc = GC . win32_new ( hDC , data ) ; RECT cellRect = item . getBounds ( nmcd . dwItemSpec , nmcd . iSubItem , true , true , true , true , hDC ) ; Event event = new Event ( ) ; event . item = item ; event . gc = gc ; event . index = nmcd . iSubItem ; event . detail |= SWT . FOREGROUND ; if ( ( OS . SendMessage ( handle , LVM_GETNEXTITEM , ( - 1 ) , LVNI_FOCUSED ) ) == ( nmcd . dwItemSpec ) ) { if ( ( ( nmcd . iSubItem ) == 0 ) || ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) ) { if ( ( handle ) == ( OS . GetFocus ( ) ) ) { int uiState = OS . SendMessage ( handle , WM_QUERYUISTATE , 0 , 0 ) ; if ( ( uiState & ( OS . UISF_HIDEFOCUS ) ) == 0 ) event . detail |= SWT . FOCUSED ; } } } if ( drawSelected ) event . detail |= SWT . SELECTED ; if ( drawBackground ) event . detail |= SWT . BACKGROUND ; event . x = cellRect . left ; event . y = cellRect . top ; event . width = ( cellRect . right ) - ( cellRect . left ) ; event . height = ( cellRect . bottom ) - ( cellRect . top ) ; gc . setClipping ( event . x , event . y , event . width , event . height ) ; sendEvent ( EraseItem , event ) ; event . gc = null ; <START_BUG> int clrSelectionText = OS . GetTextColor ( hDC ) ; <END_BUG> gc . dispose ( ) ; OS . RestoreDC ( hDC , nSavedDC ) ; if ( ( isDisposed ( ) ) || ( item . isDisposed ( ) ) ) return ; if ( event . doit ) { ignoreDrawForeground = ( ( event . detail ) & ( SWT . FOREGROUND ) ) == 0 ; ignoreDrawBackground = ( ( event . detail ) & ( SWT . BACKGROUND ) ) == 0 ; ignoreDrawSelection = ( ( event . detail ) & ( SWT . SELECTED ) ) == 0 ; ignoreDrawFocus = ( ( event . detail ) & ( SWT . FOCUSED ) ) == 0 ; } else { ignoreDrawForeground = ignoreDrawBackground = ignoreDrawSelection = ignoreDrawFocus = true ; } if ( drawSelected ) { if ( ignoreDrawSelection ) { if ( ( ( nmcd . iSubItem ) == 0 ) || ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) ) { selectionForeground = clrSelectionText ; } nmcd . uItemState &= ~ ( OS . CDIS_SELECTED ) ; OS . MoveMemory ( lParam , nmcd , sizeof ) ; } } else { if ( ignoreDrawSelection ) { nmcd . uItemState |= OS . CDIS_SELECTED ; OS . MoveMemory ( lParam , nmcd , sizeof ) ; } } if ( ignoreDrawFocus ) { nmcd . uItemState &= ~ ( OS . CDIS_FOCUS ) ; OS . MoveMemory ( lParam , nmcd , sizeof ) ; } int hwndHeader = OS . SendMessage ( handle , LVM_GETHEADER , 0 , 0 ) ; boolean firstColumn = ( nmcd . iSubItem ) == ( OS . SendMessage ( hwndHeader , HDM_ORDERTOINDEX , 0 , 0 ) ) ; boolean fullText = ( explorerTheme ) || ( ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) || ( ! firstColumn ) ) ;

Fix:
int clrSelectionText = data . foreground ;