|
|
1.1.1.2 ! root 1: Sample: ! 2: ! 3: Demonstration of Setting Console Text Color Attributes 1.1 root 4: 5: Summary: 6: 7: The CONSOLEC sample illustrates the use of the 8: SetConsoleTextAttribute and GetConsoleScreenBufferInfo 9: functions to set the console text color attributes. 10: 11: More Information: 12: 13: This sample also functions as a console window text color 14: setting utility. The command syntax for the utility is as 15: follows: 16: 17: COLOR FOREGROUND [BACKGROUND] 18: 19: where FOREGROUND and BACKGROUND are the new text color 20: selections for the current console. If the utility is 1.1.1.2 ! root 21: invoked without any options, the utility's syntax and a 1.1 root 22: table of the possible color choices is displayed. The 23: BACKGROUND selection is optional and thus the FOREGROUND 24: text color may be soley changed. 25: 26: Possible colors are: BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, 1.1.1.2 ! root 27: YELLOW and WHITE. Each can be selected as the FOREGROUND ! 28: or the BACKGROUND color. Selection of the same color for ! 29: both the FOREGROUND and the BACKGROUND is not permitted. ! 30: The color options are not case sensitive and only the first ! 31: unique characters are necessary to select the color. For ! 32: example: 1.1 root 33: 34: COLOR BLU W 35: 36: will select BLUE on WHITE text color attributes. 37: 38: The text color attribute changes will only affect new 39: console output. Thus, text in the console buffer before the 40: utility is invoked will retain their original color 41: attributes.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.