Change entire console background color (Win32 C++)
问题 How can I change the entire console's background color? I've tried SetConsoleTextAttribute and it only changes the background color of new text. I effectively want the entire console to turn red when a serious error arises. Thanks to everyone who attempts to help. 回答1: Try something like: system("color c2"); 回答2: I think the FillConsoleOutputAttribute function will do what you need. Set it to the starting coordinate of the console, and set nLength to the number of characters in the console (