To get it to look "right" on modern versions of Windows you should be looking into being theme-aware and using the
theme-aware API.
For example, for drawing backgrounds you should probably use
DrawThemeBackground instead of FillRect.
(Note: Error checking omitted)
auto theme = GetWindowTheme(hwnd);
DrawThemeBackground(theme, hdc, WP_DIALOG, 0, &rc, nullptr);
Of course, if all you want is the color...
auto theme = GetWindowTheme(hwnd);
COLORREF color;
GetThemeColor(theme, WP_DIALOG, 0, TMT_BACKGROUND, &color);
Course, you'll need to make sure
visual styles are enabled for your program. And you may want to respond to
WM_THEMECHANGED as well.
For a nice example as well as a theme exploring tool - check out
this article on CodeProject