X
X
Xasthul2017-08-23 21:38:38
C++ / C#
Xasthul, 2017-08-23 21:38:38

How to change font color in console application?

Need to change font color in C++ console program. Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2017-08-23
@Xasthul

HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, color);

color: high four bits - background color, low bits - text color

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question