How can I change the Background Color in C++?

Hi guys,

Sorry for my bad english, but i'm swiss... =)

So, my Problem is, i wrote a Program in C++ Win32. It always came in this Black box on my Screen. How can I make, that the Background Color is Blue and the Text is still White? I made it with
System("Color 2A");
But this is not very professional =)

So, how can i make it other?

Thanks for answers.

Have a nice Day!

BackBraker
to change the colors you may use the system dependend console functions:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682073%28v=vs.85%29.aspx

SetConsoleTextAttribute() may do the trick:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms686047%28v=vs.85%29.aspx
Topic archived. No new replies allowed.