DirectX SDK

DirectDraw7.GetSurfaceFromDC

The DirectDraw7.GetSurfaceFromDC method retrieves the DirectDrawSurface7 object for a surface, based on its GDI device context handle.

object.GetSurfaceFromDC(hdc As Long) As DirectDrawSurface7

Parameters

object
Object expression that resolves to a DirectDraw7 object.
hdc
Handle of a display device context.

Return Values

If the method succeeds, it returns a DirectDrawSurface7.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to one of the following 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.

See Also

Surfaces and Device Contexts