Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get window's background color

Tags:

c++

mfc

Is there any function (C++, MFC) to obtain window's background color?

like image 503
Josemi Avatar asked Jan 20 '12 12:01

Josemi


People also ask

How do I change my active window background color?

Right click on desktop and choose 'personalize'. Under My Themes, choose High Contrast theme (pick any). Once that is done, below the themes is a Box that will say 'color' 'High Contrast'.

What is the default background color in Windows 10?

The default background color for windows is white.

How do I get Windows 10 original background?

You can also head to Settings > Personalization > Background and use the “Browse” button to find the wallpaper image on your system. You can download more free desktop backgrounds by visiting the Windows Themes section in the Microsoft Store.

How do you change the background color on HTML?

To add background color in HTML, use the CSS background-color property. Set it to the color name or code you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a table, heading, div, or span tag.


1 Answers

There's a default background color for windows, use GetSysColor(COLOR_WINDOW). But ultimately a window decides itself what is 'background' and what is 'foreground'. Affected by WNDCLASS.hbrBackground and the window's WM_ERASEBKGND and WM_PAINT message handlers. Anything is possible.

like image 116
Hans Passant Avatar answered Oct 26 '22 13:10

Hans Passant