hi,
 
Xbase++ have XBPSYSCLR_* Constante which XbParts use as default.
these Color belong to active Theme and you find it in Registry "HKEY_CURRENT_USER\Control Panel\Colors"
 
Xbase++ have a Demo \samples\basics\PRESPARA\panel.prg to show these Color
 
now my Problem is there are 31 COLOR_* Constante in WinUser.h but 51 XBPSYSCLR_* in XBP.CH ... so how to get right Color ?
 
---
 
loading a Theme in Windows also change Value in Registry ... and all Apps will use that Theme and Color
you can set those Theme Color with SetSysColors() e.g. change Scrollbar Color
 
it seems not to work with Xbase++ DLLFUNCTION() but it work with ot4xb
 
[code]
#include "ot4xb.ch"
#include "WinUser_constants.ch"
 
#include "gra.ch"
#include "dll.ch"
DLLFUNCTION SetSysColors(n,@s,@v) USING STDCALL FROM USER32.DLL
DLLFUNCTION GetSysColor(n) USING STDCALL FROM USER32.DLL
 
PROCEDURE MAIN
   #IFDEF Does_Not_Work
      SetSysColors(1, {COLOR_SCROLLBAR}, {AutomationTranslateColor(GRA_CLR_PINK,.F.)})
   #ELSE
      @User32:SetSysColors(1, {COLOR_SCROLLBAR}, {AutomationTranslateColor(GRA_CLR_PINK,.F.)})
   #ENDIF
RETURN
[/code]
 
 
[Url]https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-getsyscolor[/Url]
[quote]The function returns the red, green, blue (RGB) color value of the given element.[/quote]
 
[Url]https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setsyscolors[/Url]
[quote]An array of COLORREF values that contain the new red, green, blue (RGB) color values for the display elements in the array pointed to by the lpaElements parameter.[/quote]
 
using API Function "SetSysColor" you can use those 30 COLOR_* Constante from WinUser.H
 
! Note : using Setsyscolors() will NOT written into Registry
 
so after re-Login all Color are default like before  :)
 

Virenfrei. www.avg.com