SetScreenAreaAttribute

Sets the display adapter attribute bytes for an area of the current screen

Local Servers:nonblocking
Remote Servers:N/A
Classification:4.x, 5.x, 6.x
Service:Screen Handling

Syntax

  #include <nwconio.h>  
   
  Long SetScreenAreaAttribute  (  
     LONG   line,   
     LONG   column,   
     LONG   numLines,   
     LONG   numColumns,   
     LONG   attribute); 
  

Parameters

line

(IN) Specifies the row number of the top line in the screen area.

column

(IN) Specifies the column number of the left column in the screen area.

numLines

(IN) Specifies the number of rows to be included in the screen area.

numColumns

(IN) Specifies the number of columns to be included in the screen area.

attribute

(IN) Specifies the value of the attribute to be set. This value depends upon the type of monitor present.

Return Values

This function returns a value of ESUCCESS (0) if successful. Otherwise, it returns a nonzero value.

Remarks

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.

See Also

SetScreenCharacterAttribute, SetScreenRegionAttribute

Example

  #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 */  
     }  
  }