Is it possible to color one given line in the console without entering text?

This is usually done with SetConsoleTextAttribute()and then with text. But is it possible to change the colors of the lines after the text has been written to the line?

+3
source share
2 answers

At least if memory is used, it WriteConsoleOutputAttributecan do it.

Edit: ... or, if you want the block to be set to the same attribute, you can use FillConsoleOutputAttribute.

+3
source

No, but you can set the cursor back to this line, change the color, rewrite the text, and then go back to where the cursor was before going to the rewrite.

++ ( , "Hello World!" ☺), ...

+1