Get window background color

Is there any function (C ++, MFC) for getting the background color of a window?

+7
source share
2 answers
CDC* pDc= GetDC(); COLORREF crBkgnd = pDc->GetBkColor(); 
+5
source

For the background, the default background color is used, use GetSysColor (COLOR_WINDOW). But in the end, the window decides what the background is and what the foreground is. WNDCLASS.hbrBackground and the message handler windows WM_ERASEBKGND and WM_PAINT are affected. Everything is possible.

+6
source

All Articles