Sets the display adapter attribute bytes for a character on the current screen
#include <nwconio.h>
Long SetScreenCharacterAttribute (
LONG line,
LONG column,
LONG attribute);
(IN) Specifies the row number of the character’s position.
(IN) Specifies the column number of the character’s position.
(IN) Specifies the value of the attribute to be set. This value depends upon the type of monitor present.
This function returns a value of ESUCCESS (0) if successful. Otherwise, it returns a nonzero value.
This function changes the attribute for a character that has been sent to the screen. Whenever you send a character to a screen, the output is written with a white-on-black attribute (0x07). If you want to change the attribute for the character, you must call this function after you write the character to the screen.
#include <stdio.h>
#include <stdlib.h>
#include <nwconio.h>
#include <nwthread.h>
main()
{
int i;
for (i = 0; i < 14;i++)
{
gotoxy(i, i);
printf("COLOR TEST");
getch(); /* to create a pause between colors */
SetScreenCharacterAttribute(i, i, i);
}
}