VB Code:
  1. Option Explicit
  2.  
  3. Dim WithEvents vbLink As EventVB.APIFunctions
  4. Dim WithEvents vbWnd As EventVB.ApiWindow
  5.  
  6. Private Sub Form_Load()
  7.  
  8. Set vbLink = New APIFunctions
  9.  
  10. Set vbWnd = New ApiWindow
  11. vbWnd.hWnd = Me.hWnd
  12.  
  13. vbLink.SubclassedWindows.Add vbWnd
  14.  
  15. End Sub
  16.  
  17. Private Sub Form_Unload(Cancel As Integer)
  18.  
  19. vbLink.SubclassedWindows.Remove vbWnd
  20.  
  21. End Sub
  22.  
  23. Private Sub vbWnd_ControlColour(ByVal ControlType As EventVB.StandardControlTypes, ByVal DeviceContext As EventVB.ApiDeviceContext, ByVal ControlWindow As EventVB.ApiWindow, ColourBrush As EventVB.ApiLogBrush)
  24.  
  25. Dim colThis As ApiColour
  26.  
  27. Set colThis = New ApiColour
  28. With colThis
  29.     .Blue = 255
  30.     .Green = 0
  31.     .Red = 0
  32. End With
  33.  
  34. If ControlType = Control_Scrollbar Then
  35.     Set ColourBrush.Colour = colThis
  36. End If
  37.  
  38. End Sub