IDirectDrawSurface::SetPalette
HRESULT SetPalette(LPDIRECTDRAWPALETTE lpDDPalette);
Attaches the specified DirectDrawPalette to a surface. The surface will use this palette for all subsequent operations. The palette change takes place immediately, without regard to refresh timing.
·Returns DD_OK if successful, or one of the following error values otherwise:
DDERR_GENERIC DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS DDERR_INVALIDSURFACETYPE
DDERR_NOEXCLUSIVEMODE DDERR_NOPALETTEATTACHED
DDERR_NOPALETTEHW DDERR_NOT8BITCOLOR
DDERR_SURFACELOST DDERR_UNSUPPORTED
lpDDPalette
Address of the DirectDrawPalette structure that this surface should use for future operations.