'>function GetSysColor$(Item)
'
'Cameron Arnott
'blue_steel@globalfreeway.com.au
'
' Gets the system color for the Windows area referred to by
' nIndex.  It returns the color value of that area.  Handy
' for setting the system colors back at the end of a program
' in which you have changed them.
'  We use the Windows constants eg: COLOR_MENU,
' but of course LB requires that Windows constants
' be preceeded by an underscore character IE: _COLOR_MENU
'
'[
variable$ = GetSysColor$(Item)
']
'{
function GetSysColor$(Item)
'
' WHERE Item is one of the following
' Windows Constant _COLOR_SCROLLBAR = 0
' Windows Constant _COLOR_BACKGROUND = 1
' Windows Constant _COLOR_ACTIVECAPTION = 2
' Windows Constant _COLOR_INACTIVECAPTION = 3
' Windows Constant _COLOR_MENU = 4
' Windows Constant _COLOR_WINDOW = 5
' Windows Constant _COLOR_WINDOWFRAME = 6
' Windows Constant _COLOR_MENUTEXT = 7
' Windows Constant _COLOR_WINDOWTEXT = 8
' Windows Constant _COLOR_CAPTIONTEXT = 9
' Windows Constant _COLOR_ACTIVEBORDER = 10
' Windows Constant _COLOR_INACTIVEBORDER  = 11
' Windows Constant _COLOR_APPWORKSPACE  = 12
' Windows Constant _COLOR_HIGHLIGHT = 13
' Windows Constant _COLOR_HIGHLIGHTTEXT = 14
' Windows Constant _COLOR_BTNFACE = 15
' Windows Constant _COLOR_BTNSHADOW = 16
' Windows Constant _COLOR_GRAYTEXT = 17
' Windows Constant _COLOR_BTNTEXT = 18
' Windows Constant _COLOR_ENDCOLORS = _COLOR_BTNTEXT
'
    open "user" for dll as #user
        calldll #user,  "GetSysColor",_
        Item as word,_
        ItemColor as long
    close #user

' ** RETRIEVE VALUES FOR red, green, blue
    blue  = int(ItemColor / (256 * 256))
    green = int((ItemColor - blue *256*256) / 256)
    red   = ItemColor - blue *256 * 256 - green * 256

    GetSysColor$="color ";red;" ";green;" ";blue

end function
'
'}
