I was searching how to get system theme color. I found GetSysColor
and GetSysColorBrush
. Then I tested it with something like that:
cout << GetSysColorBrush(COLOR_HIGHLIGHT) << endl; //checking the value if it's changing when
//changing system color
WNDCLASSW wc = {0};
wc.hbrBackground = GetSysColorBrush(COLOR_HIGHLIGHT);
wc.hCursor = LoadCursorA(NULL, IDC_ARROW);
wc.hInstance = hInst;
wc.lpfnWndProc = WindowProc;
wc.lpszClassName = L"WindowClass";
if(!RegisterClassW(&wc)) return -1;
CreateWindowW(L"WindowClass", L"Window Name", WS_VISIBLE | WS_POPUP, 0, 0, windowWidth - 500,
windowHeight - 500, NULL, NULL, NULL, NULL);
I thought it works, because I had default blue theme and the window was blue (exactly same color), then i changed my theme to green but window was still blue (after restarting program obviously).
And now my question: Is it possible to get current system theme color?