Summary:
Determines if TitleBar Gradient effect is enabled.

Please note: This code requires Win 98/ME/2k/XP. You would probably want to check for Windows version before executing this code.

VB Code:
  1. 'declare api functions
  2.     Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" _
  3.         (ByVal uAction As Long, _
  4.         ByVal uParam As Long, _
  5.         ByVal lpvParam As Any, _
  6.         ByVal fuWinIni As Long) As Long
  7.  
  8. 'declare constants
  9.     Public Const SPI_GETGRADIENTCAPTIONS = &H1008

Usage Example:
VB Code:
  1. Dim bGradientEnabled as Boolean
  2.  
  3. bGradientEnabled = CBool(SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0&, "", 0&))

Return Values:
Will return True if TitleBar Gradient is enabled, False otherwise.

Notes:
The declarations for API functions, constants, types and the GetRGBColors function can be moved to a module. If so, they should be declared as Public.

See Also:
Determine Windows Version