GetSystemPaletteUse

3.0

  UINT GetSystemPaletteUse(hdc)    
  HDC hdc; /* handle of device context */

The GetSystemPaletteUse function determines whether an application has access to the entire system palette.

Parameters

hdc

Identifies the device context. This device context must support color palettes.

Return Value

The return value specifies the current use of the system palette, if the function is successful. This parameter can be one of the following values:

Value Meaning

SYSPAL_NOSTATIC System palette contains no static colors except black and white.
SYSPAL_STATIC System palette contains static colors that do not change when an application realizes its logical palette.

Comments

The system palette contains 20 default static colors that are not changed when an application realizes its logical palette. An application can gain access to most of these colors by calling the SetSystemPaletteUse function.

Example

The following example uses the GetDeviceCaps function to determine whether the specified device is palette-based. If the device supports palettes, the GetSystemPaletteUse function is called.

WORD nUse;

hdc = GetDC(hwnd);
if ((GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE) == 0) {
    ReleaseDC(hwnd, hdc);
    break;
}
nUse = GetSystemPaletteUse(hdc);
ReleaseDC(hwnd, hdc);

See Also

GetDeviceCaps, SetSystemPaletteUse