Microsoft DirectX 9.0


The GetDefaultColorKey method retrieves the default color key used for a chroma key overlay.


HRESULT GetDefaultColorKey(
  COLORKEY *pColorKey



[out] Pointer to a variable that receives the default color key.

Return Value

Returns S_OK if successful. If the method fails, it returns an HRESULT error code.


A filter using color keys can get a default color from the video renderer. The default color key can then be installed into the window using IOverlay::SetColorKey. The colors returned through this method vary depending on the current display mode. If the colors are 8-bit palettized, they will be bright system colors (such as magenta). If the display is in a true-color mode, they will be shades of black.

The IOverlay interface is used to ensure that separate instances of the renderer on the same computer get different color keys so that overlays do not conflict.

See Also