Platform SDK: DirectX

IDirectDrawSurface7::ReleaseDC

The IDirectDrawSurface7::ReleaseDC method releases the handle of a device context previously obtained by using the IDirectDrawSurface7::GetDC method.

HRESULT ReleaseDC(
  HDC hDC  
);

Parameters

hDC
Handle of a device context previously obtained by IDirectDrawSurface7::GetDC.

Return Values

If the method succeeds, the return value is DD_OK.

If it fails, the method can return one of the following error values:

DDERR_GENERIC
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_SURFACELOST
DDERR_UNSUPPORTED

Remarks

This method also unlocks the surface previously locked when the IDirectDrawSurface7::GetDC method was called.

ReleaseDC must be called from the same thread that called GetDC.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in ddraw.h.

See Also

IDirectDrawSurface7::GetDC