[API]
Public RECT
CreateSolidBrush
DeleteObject
FillRect
GetSysColor
SelectObject

[CODE]
Public Function DC_FillRectRGB(ByVal hDC As Long, ByRef xFillRect As RECT, ByVal Color As ColorConstants) As Boolean
  Dim hBrush As Long
  Dim hBrushOld As Long

  If Color < 0& Then
    If (Color And &H70000000) Then
      DC_FillRectRGB = Not (FillRect(hDC, xFillRect, GetSysColor(-Color)) = 0&)
      Else
      DC_FillRectRGB = Not (FillRect(hDC, xFillRect, GetSysColor(Color And &H3FFFFFFF)) = 0&)
      End If
    Else
    hBrush = CreateSolidBrush(Color)
    If Not hBrush = 0& Then
      hBrushOld = SelectObject(hDC, hBrush)
      If Not hBrushOld = 0& Then
        DC_FillRectRGB = Not (FillRect(hDC, xFillRect, hBrush) = 0&)
        Call SelectObject(hDC, hBrushOld)
        End If
      Call DeleteObject(hBrush)
      End If
    End If
  End Function
