-
Notifications
You must be signed in to change notification settings - Fork 0
/
setconsole.cpp
32 lines (27 loc) · 1.46 KB
/
setconsole.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;
int main(){
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_INTENSITY);
cout << "This text should be blue" << endl;
SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN | FOREGROUND_INTENSITY);
cout << "This text will be green" << endl;
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_INTENSITY);
cout << "this text will be red" << endl;
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY);
cout << "Now the test will start" << endl;
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY);
cout << "This text should be purple" << endl;
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN |FOREGROUND_INTENSITY);
cout<< "this text should be in cyan" << endl;
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY);
cout << "this text would be in yellow" << endl;
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY);
cout << "This text would be in white" << endl;
SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
cout << "This should be a mysterious color" << endl;
getch();
return 0;
}