Sets the display adapter attribute bytes for an area of the current screen
#include <nwconio.h>
Long SetScreenAreaAttribute (
LONG line,
LONG column,
LONG numLines,
LONG numColumns,
LONG attribute);
(IN) Specifies the row number of the top line in the screen area.
(IN) Specifies the column number of the left column in the screen area.
(IN) Specifies the number of rows to be included in the screen area.
(IN) Specifies the number of columns to be included in the screen area.
(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 characters that have been sent to the specified area of 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 characters in that area, you must call this function after you write the characters 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");
SetScreenCharacterAttribute(i, i, i);
SetScreenAreaAttribute(0, 64, i, 14-i, i*16);
getch() /* to create a pause between colors */
}
}