Windows Dev Center

IDirectDraw7::GetSurfaceFromDC method

Retrieves the IDirectDrawSurface7 interface for a surface, based on its GDI device context handle.

Syntax


HRESULT GetSurfaceFromDC(
  [in]  HDC                  hdc,
  [out] LPDIRECTDRAWSURFACE7 *lpDDS
);

Parameters

hdc [in]

Handle of a display device context.

lpDDS [out]

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.

You must use LoadLibrary to explicitly link to Ddraw.dll and then use GetProcAddress to access the GetSurfaceFromDC method.

Requirements

Header

Ddraw.h

Library

Ddraw.lib

DLL

Ddraw.dll

See also

IDirectDraw7

 

 

Community Additions

ADD
Show:
© 2015 Microsoft