wglGetCurrentDC

The wglGetCurrentDC function obtains a handle to the device context that is associated with the current OpenGL rendering context of the calling thread.

HDC wglGetCurrentDC(VOID);

Parameters

This function has no parameters.

Return Values

If the calling thread has a current OpenGL rendering context, the function returns a handle to the device context associated with that rendering context by means of the wglMakeCurrent function. Otherwise, the return value is NULL.

Remarks

You associate a device context with an OpenGL rendering context when it calls the wglMakeCurrent function. You can use the wglGetCurrentContext function to obtain a handle to the calling thread's current OpenGL rendering context.

QuickInfo

  Windows NT: Use version 3.5 and later.
  Windows: Use Windows 95 and later.
  Windows CE: Unsupported.
  Header: Declared in wingdi.h.
  Import Library: Link with opengl32.lib.

See Also

OpenGL on Windows NT and Windows 95 Overview, WGL Functions, wglCreateContext, wglDeleteContext, wglGetCurrentContext, wglMakeCurrent