Нашёл! Вот код на изменение систиемных цветов Windows!!! 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) 'Можно использовать следующие константы
Private Const COLOR_SCROLLBAR = 0 'The Scrollbar colour Private Const COLOR_BACKGROUND = 1 'Colour 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 Dim OldColorMenuProst As Long Dim OldColor As Long Dim OldText As Long Dim OldButtonTextColor As Long Dim OldColorButton As Long Dim OldActiveCaption As Long Dim OldColor as Long Private Sub Form_Load() 'Например изменим цвет заголовка окна 'получаем цвет OldColor = GetSysColor(COLOR_ACTIVECAPTION) 'ставим SetSysColors 1, COLOR_ACTIVECAPTION, RGB(255, 0, 0)
End Sub Private Sub Form_Unload(Cancel As Integer) 'Восстанавливаем текущий цвет SetSysColors 1, COLOR_ACTIVECAPTION, OldColor End Sub 'Все на ОК!
Ответить
|