borderAndreaVB free resources for Visual Basic developersborder

AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincani
:: Set or read the current user desktop color settings

Author  

Andrea Tincani

Language  

VB5, VB6

Operating Systems  

Windows 95, 98 and NT
API Declarations

Option Explicit

Private Declare Function GetSysColor Lib "user32.dll" (ByVal nindex As Long) As Long
Private Declare Function SetSysColors Lib "user32.dll" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long

Public Enum WindowsItem
    COLOR_ACTIVEBORDER = 10
    COLOR_ACTIVECAPTION = 2
    COLOR_APPWORKSPACE = 12
    COLOR_BACKGROUND = 1
    COLOR_BTNFACE = 15
    COLOR_BTNHIGHLIGHT = 20
    COLOR_BTNSHADOW = 16
    COLOR_BTNTEXT = 18
    COLOR_CAPTIONTEXT = 9
    COLOR_GRAYTEXT = 17
    COLOR_HIGHLIGHT = 13
    COLOR_HIGHLIGHTTEXT = 14
    COLOR_INACTIVEBORDER = 11
    COLOR_INACTIVECAPTION = 3
    COLOR_INACTIVECAPTIONTEXT = 19
    COLOR_MENU = 4
    COLOR_MENUTEXT = 7
    COLOR_SCROLLBAR = 0
    COLOR_WINDOW = 5
    COLOR_WINDOWFRAME = 6
    COLOR_WINDOWTEXT = 8
End Enum

Module

Public Function GetWindowsColor(Item As WindowsItem) As OLE_COLOR
    GetWindowsColor = GetSysColor(Item)
End Function

Public Sub SetWindowsColor(Item As WindowsItem, Color As OLE_COLOR)
    SetSysColors 1, Item, Color
End Sub

:: Navigation

Home

Video, Bitmaps and Colors Tips

Previous Tip

Next Tip

:: Search this site
Google
:: Related Topics
icon 06-02-2008 Re: Gracefully Handling Multiple Users Accessing the Same File Simultaneously by stickleprojects
icon 01-02-2008 Gracefully Handling Multiple Users Accessing the Same File Simultaneously by matt_1ca
icon 30-12-2007 Re: Need Help On Desire to Implement Proactive Support by stickleprojects
icon 08-11-2007 Re: Database properties by stickleprojects
icon 30-05-2007 Re: Randomize generate massive user name database? by JLRodgers
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder