I want to change the frame color of all windows on a PC using the SetSysColor API. i implemeted the API as shown below but nothign happens. No errors but no color change either. I'm testing this on an XP machine.
vb Code:
Public Declare Function SetSysColors Lib "user32" _ (ByVal nChanges As Integer, _ ByVal lpSysColor As Integer, _ ByVal lpColorValues As Integer) As Boolean Public Declare Function GetSysColor Lib "user32" _ (ByVal nIndex As Integer) As Integer Private Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window Private Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window Private Const COLOR_CAPTIONTEXT = 9 Private OriginalActiveColor As Long ' Holds original active title bar color Private OriginalInactiveColor As Long ' Holds original inactive title bar color Public Sub InitColors() OriginalActiveColor = GetSysColor(COLOR_ACTIVECAPTION) OriginalInactiveColor = GetSysColor(COLOR_INACTIVECAPTION) End Sub Public Sub ResetColors() ' Resets the original system colors SetSysColors(1, COLOR_ACTIVECAPTION, OriginalActiveColor) SetSysColors(1, COLOR_INACTIVECAPTION, OriginalInactiveColor) End Sub Public Sub ChangeColors() ' Change active title bar color to black SetSysColors(1, COLOR_ACTIVECAPTION, RGB(0, 0, 0)) ' Change inactive title bar color to black SetSysColors(1, COLOR_INACTIVECAPTION, RGB(0, 0, 0)) End Sub




Reply With Quote