IDirectDraw7::GetSurfaceFromDC method (ddraw.h)
Retrieves the IDirectDrawSurface7 interface for a surface, based on its GDI device context handle.
Syntax
HRESULT GetSurfaceFromDC(
[in] HDC unnamedParam1,
[out] LPDIRECTDRAWSURFACE7 *unnamedParam2
);
Parameters
[in] unnamedParam1
Handle of a display device context.
[out] unnamedParam2
Address of a variable to be filled with a pointer to the IDirectDrawSurface7 interface for the surface if the call succeeds.
Return value
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
Remarks
This method succeeds only for device context handles that identify surfaces already associated with the DirectDraw object.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | ddraw.h |
Library | Ddraw.lib |
DLL | Ddraw.dll |