UpdateColors

  BOOL UpdateColors(hdc)    
  HDC hdc; /* handle of device context */

The UpdateColors function updates the client area of the given device context by remapping the current colors in the client area to the currently realized palette.

Parameters

hdc

Identifies the device context.

Return Value

The return value is TRUE if the function is successful. Otherwise it is FALSE.

Comments

An inactive window with a realized logical palette may call UpdateColors as an alternative to redrawing its client area when the system palette changes.

UpdateColors typically updates a client area faster than redrawing the area. However, because UpdateColors performs the color translation based on the color of each pixel before the system palette changed, each call to this function results in the loss of some color accuracy.

This call should be made soon after a WM_SYSPALETTECHANGE message is received.