Sets the display attribute bytes for the current screen
#include <nwconio.h>
int SetScreenAttributes (
LONG mask,
LONG attr);
(IN) Specifies the attributes you want to set or clear:
(IN) Specifies the attributes to set, using the same values as the mask parameter. To set an attribute, it must be specified in both the mask and attr parameters. To clear an attribute, it must be specified in only the mask paramter.
Returns a value of ESUCCESS (0) if successful. Otherwise, it returns a nonzero value.
SetScreenAttributes sets and clears various bit flags. For example:
SetScreenAttributes(DONT_SWITCH_SCREEN|AUTO_DESTROY_SCREEN, DONT_SWITCH_SCREEN);
This sets the DONT_SWITCH_SCREEN attribute and clears the AUTO_DESTROY_SCREEN attribute. Bit attributes that are not specified in mask are not affected.
Before setting the DONT_SWITCH_SCREEN bit, you need to know if the screen is a popup screen (use GetScreenInfo). If the screen is a popup screen, you need to call DropPopUpScreen one or more times. Each call to DropPopUpScreen decrements the popup screen in-use count. When the in-use count reaches 0, the function sets the DONT_SWITCH_SCREEN bit on the popup screen.