Java: get window color

I will be brief: how to get the color that the user can specify on the Windows platform? In windows 10, this is the color of the tiles when you open the Start menu. SystemColor does not work, it simply returns the color 153 180 209 (cyan) for SystemColor.activeCaption regardless of which parameter is set for each version of the windows. UIManager almost useless. Key names appear different in each version of the windows. SystemColor work on Mac and Linux. Any ideas on how I get this color? Thanks.

+5
source share
1 answer

Learned how to do this recently. The Windows registry contains the value HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\AccentColor , which stores the color of the title bar of the system window. You can use JNA Advapi32Util to read values ​​from the Windows registry.

Then you can use a graphics library like java.awt.Color to convert the color to RGB values.

There is an implementation of this here

0
source

All Articles