CTerminalEmulator::SetColor Method  
 
BOOL SetColor(
  UINT nColorIndex,  
  COLORREF dwColor,  
  BOOL bForeground  
);

The SetColor method sets the colors used by the virtual display. Each display has a color table which specifies the foreground and background colors used when displaying text with a specific attribute.

Parameters

nColorIndex
The index into the virtual display color table. It may be one of the following values.
Value Description
NVT_COLOR_NORMAL The colors displayed for normal text. These are the default colors used with the display.
NVT_COLOR_REVERSE The colors displayed for text with the reverse attribute set. This is only used when emulation is enabled.
NVT_COLOR_BOLD The colors displayed for text with the bold attribute set. This is only used when emulation is enabled.
NVT_COLOR_REVERSEBOLD The colors displayed for text with the reverse and bold attributes set. This is only used when emulation is enabled.
dwColor
The RGB color value that will be used.
bForeground
A boolean flag which specifies if the color is a foreground color, used when displaying text, or a background color.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, it returns zero.

Remarks

The default colors for the display is a black background and white foreground. Bold characters are displayed on a white background and blue foreground.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csnvtv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also