Created
July 20, 2020 05:33
-
-
Save RigoLigoRLC/0960c9dab9e04c537664bf17907edace to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <iostream> | |
int main() | |
{ | |
CONSOLE_SCREEN_BUFFER_INFO info; | |
HANDLE hdl = GetStdHandle(STD_OUTPUT_HANDLE); | |
GetConsoleScreenBufferInfo(hdl, &info); | |
WORD wBackgroundColor = info.wAttributes & (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY ); | |
SetConsoleTextAttribute(hdl, FOREGROUND_RED | FOREGROUND_INTENSITY | wBackgroundColor); | |
std::cout << "hello, world" << std::endl; | |
SetConsoleTextAttribute(hdl, info.wAttributes); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment