DirectX SDK |
The IDirectDraw7::GetSurfaceFromDC method retrieves the IDirectDrawSurface7 interface for a surface, based on its GDI device context handle.
HRESULT GetSurfaceFromDC( HDC hdc, LPDIRECTDRAWSURFACE7 * lpDDS );
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_INVALIDPARAMS |
DDERR_OUTOFMEMORY |
DDERR_NOTFOUND |
This method succeeds only for device context handles that identify surfaces already associated with the DirectDraw object.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 98.
Header: Declared in ddraw.h.