Microsoft DirectX 9.0

IDirectDrawSurface::GetColorKey

The GetColorKey method returns the color key value for the DirectDrawSurface object.

Syntax

HRESULT GetColorKey(
  DWORD dwFlags,
  LPDDCOLORKEY lpDDColorKey
  );

Parameters

dwFlags

Determines which color key is being requested.

Value Description
DDCKEY_COLORSPACE Set if the structure contains a colorspace. Not set if the structure contains a single color key.
DDCKEY_DESTBLT Set if the structure specifies a color key or color space which is to be used as a destination color key for blit operations.
DDCKEY_DESTOVERLAY Set if the structure specifies a color key or color space which is to be used as a destination color key for overlay operations.
DDCKEY_SRCBLT Set if the structure specifies a color key or color space which is to be used as a source color key for blit operations.
DDCKEY_SRCOVERLAY Set if the structure specifies a color key or color space which is to be used as a source color key for overlay operations.

lpDDColorKey

Points to the DDCOLORKEY structure that will be filled in with the current values for the specified color key for the DirectDrawSurface object.

Return Values

Value Description
DD_OK The method succeeded.
DDERR_INVALIDOBJECT DirectDraw received a pointer that was an invalid DirectDraw object.
DDERR_INVALIDPARAMS One or more of the input parameters is invalid.
DDERR_SURFACELOST Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it.
DDERR_UNSUPPORTED Action not supported.
DDERR_NOCOLORKEYHW Operation could not be carried out because there is no hardware support of the destination color key.
DDERR_NOCOLORKEY Surface doesn't currently have a color key.

See Also