SetSystemPaletteUse

  UINT SetSystemPaletteUse(hdc, uUsage)    
  HDC hdc; /* handle of device context */
  UINT uUsage; /* palette-usage flag */

The SetSystemPaletteUse function allows an application to specify whether the system palette contains 2 or 20 static colors. The default system palette contains 20 static colors (static colors cannot be changed when an application realizes a logical palette).

Parameters

hdc

Identifies the device context. (This device context must refer to a device which supports color palettes.)

uUsage

Specifies the new use of the system palette. It can be either of these values:

Value Meaning

SYSPAL_NOSTATIC  
  System palette contains two static colors (black and white).
SYSPAL_STATIC  
  System palette contains static colors which will not change when an application realizes its logical palette.

Return Value

The return value specifies the previous usage of the system palette if the function is successful—it can be either SYSPAL_NOSTATIC or SYSPAL_STATIC. Otherwise it is SYSPAL_ERROR.

Comments

When an application's window moves to the foreground and has set SYSPAL_NOSTATIC, it should call GetSysColors to save the current system colors setting. It should also call SetSysColors to set reasonable values using only black and white. When the application returns to the background or terminates, the previous system colors should be restored.

See Also

GetSysColor, SetSysColors