anyone know how to make the titlebar and border black when active (focus) and inactive
Printable View
anyone know how to make the titlebar and border black when active (focus) and inactive
As far as I know, this is controlled by the system settings, so you would have to change the way windows are displayed system-wide.
If it is possible I would not know how to do it either because it is set by the system. Although I am sur eone of these API freaks on this page know of a way because nothing's impossible.
You don't have to be an API "freak", just check out http://www.mentalis.org/apilist/SetSysColors.shtml
Here's an example that works, unless you're using XP theme which doesn't allow changing title bar colors (put two command buttons on a form and run this code):VB Code:
Option Explicit Private Declare Function SetSysColors Lib "user32" _ (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long Private Declare Function GetSysColor Lib "user32" _ (ByVal nIndex As Long) As Long Private Const COLOR_SCROLLBAR = 0 'The Scrollbar color Private Const COLOR_BACKGROUND = 1 'The Color of the background with no wallpaper Private Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window Private Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window Private Const COLOR_MENU = 4 'Menu Private Const COLOR_WINDOW = 5 'Windows background Private Const COLOR_WINDOWFRAME = 6 'Window frame Private Const COLOR_MENUTEXT = 7 'Window Text Private Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95) Private Const COLOR_CAPTIONTEXT = 9 'Text in window caption Private Const COLOR_ACTIVEBORDER = 10 'Border of active window Private Const COLOR_INACTIVEBORDER = 11 'Border of inactive window Private Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop Private Const COLOR_HIGHLIGHT = 13 'Selected item background Private Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item Private Const COLOR_BTNFACE = 15 'Button Private Const COLOR_BTNSHADOW = 16 '3D shading of button Private Const COLOR_GRAYTEXT = 17 'Grey text, of zero if dithering is used. Private Const COLOR_BTNTEXT = 18 'Button text Private Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive window Private Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button Private Const COLOR_2NDACTIVECAPTION = 27 'Win98 only: 2nd active window color Private Const COLOR_2NDINACTIVECAPTION = 28 'Win98 only: 2nd inactive window color Private OriginalActiveColor As Long ' Holds original active title bar color Private OriginalInactiveColor As Long ' Holds original inactive title bar color Private Sub ResetColors() ' Resets the original system colors SetSysColors 1, COLOR_ACTIVECAPTION, OriginalActiveColor SetSysColors 1, COLOR_INACTIVECAPTION, OriginalInactiveColor End Sub Private 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 Private Sub Command1_Click() ResetColors End Sub Private Sub Command2_Click() ChangeColors End Sub Private Sub Form_Load() Command1.Caption = "Reset Colors" Command2.Caption = "Change Colors" OriginalActiveColor = GetSysColor(COLOR_ACTIVECAPTION) OriginalInactiveColor = GetSysColor(COLOR_INACTIVECAPTION) End Sub
Right on, hey don't get me wrong about the "Freaks" crack, when I call someone some said name reffering to something they're awsome at doing I am simply complementing said person(s).
Thanx a lot for the code too.
:D
~~Edited to add~~
So that changes just you apps colors right?
No, it changes the system colors for all windows. da_hacker's link above shows you how to change just your title bar (actually it replaces your title bar with a user control).Quote:
Originally posted by Spajeoly
So that changes just you apps colors right?
Generally speaking - it's not a good idea to change someone's system settings. Personally I would dump any app that does this sort of things.
As would I.
I couldn't agree with you more. Unless it also changed my homepage and desktop background without asking. Then I would love it! ;)Quote:
Originally posted by McGenius
Generally speaking - it's not a good idea to change someone's system settings. Personally I would dump any app that does this sort of things.
Ooo ooo ooo, don't forget about changing the registry to nonexistant!!!