Reputation: 29387
Normally this is done by SetConsoleTextAttribute()
and then writting text. But it is possible to change line colors after text has been written to the line ?
Upvotes: 3
Views: 1198
Reputation: 490138
At least if memory serves, WriteConsoleOutputAttribute
can do that.
Edit: ...or, if you want a block all set to the same attribute, you can use FillConsoleOutputAttribute
.
Upvotes: 3
Reputation: 9430
No, but you can set the cursor back up to that line, change color, rewrite the text, then jump back to where the cursor was before the jump to rewrite.
I'm not an expert c++ programmer (despite wearing my "Hello World!" t shirt today ☺), so I can't give you any help...
Upvotes: 1