SetScreenCharacterAttribute

Sets the display adapter attribute bytes for a character on 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 SetScreenCharacterAttribute  (  
     LONG   line,   
     LONG   column,   
     LONG   attribute); 
  

Parameters

line

(IN) Specifies the row number of the character’s position.

column

(IN) Specifies the column number of the character’s position.

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 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.

See Also

SetScreenAreaAttribute, 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");  
        getch();    /* to create a pause between colors */  
        SetScreenCharacterAttribute(i, i, i);  
     }  
  }