[WinAPI] Color TextOut() and the background color of the window is not the same, how to put same color in both of them?

The problem is that the window contains text and his background doesn't blend with the window background.
It looks like this:
5ca124cd49d90971871815.png

The color of the actual window looks like this:
...
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
...


Change the color of text using this function:
SetBkColor(hdc, ...);
The second parameter is the desired COLORREF, it can be obtained using the macro RGB(), but what COLOR_WINDOW, RGB?
I tried to read it like this:
SetBkColor(hdc, RGB(
GetRValue(GetSysColor(COLOR_WINDOW)),
GetGValue(GetSysColor(COLOR_WINDOW)),
GetBValue(GetSysColor(COLOR_WINDOW))
 ));

But the text remains completely white.
Of course, using Photoshop I found that this is 240;240;240, but it does not fit.
What to do?

PS
These functions
GetRValue(GetSysColor(COLOR_WINDOW)),
GetGValue(GetSysColor(COLOR_WINDOW)),
GetBValue(GetSysColor(COLOR_WINDOW))

Output 255;255;255, and if you use COLOR_WINDOW - 1(which corresponds to the COLOR_MENU), the answer is correct(240;240;240), why is this happening?
March 19th 20 at 09:28
1 answer
March 19th 20 at 09:30
SetBkMode(hdc, TRANSPARENT) ?
The background became black.
5ca128aa862ae034944242.png - lindsay commented on March 19th 20 at 09:33

Find more questions by tags C++