notes/pl/cpp/api/console.txt
Ihar Hancharenka 5dff80e88e first
2023-03-27 16:52:17 +03:00

17 строки
477 B
Plaintext

//Hyper-console
#include <iostream.h>
#include <stdlib.h>
#include <windows.h> // WinApi header
int main()
{
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
for(unsigned c1=0; c1<=0xF; c1++)
for(unsigned c2=0; c2<=0xF; c2++){
unsigned color=c2+(c1<<4);
SetConsoleTextAttribute(hConsole, color);
cout<<"bgColor: "<<c1<<" textColor: "<<c2<<" Color: "<<hex<<color<<endl;
};
system("PAUSE");
return 0;
}