How to get the taskbar color?

Heiko 1,291 Reputation points
2023-07-13T12:56:17.7233333+00:00

I want to make my app the same color as the taskbar.

1)
In Windows 10 it is possible to use the accent color for the taskbar. How do I determine if the taskbar is in the accent color?

2)
Under Windows 10, if the taskbar is not in the accent color, how can I determine the color of the taskbar? Are there only 2 colors possible here (one for light design and one for dark design)?

3)
In Windows 11, I have not found any way in the Windows settings to display the taskbar color in the accent color or to derive it from the accent color. Do I have only 2 colors (for dark and light design) to choose from in Windows 11? How do I determine the color of the taskbar?

Developer technologies | Windows Presentation Foundation
Windows development | Windows API - Win32
Developer technologies | C++
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,686 Reputation points
    2023-07-13T14:16:12.4033333+00:00

    On Windows 10, if it uses Accent color, ColorPrevalence is set to 1

    (HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize)

    A way to get its color is to read it physically, like for example :

    https://github.com/sahandevs/Trello-Assistant/blob/e0950301b9fc70807f320bcb345f11f8f37e66b8/TrelloAsistant/Utils/TaskbarColor.cs#L28

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.