This documentation is archived and is not being maintained.

Output (Device Context) Classes

These classes encapsulate the different types of device contexts available in Windows.

Most of the following classes encapsulate a handle to a Windows device context. A device context is a Windows object that contains information about the drawing attributes of a device such as a display or a printer. All drawing calls are made through a device-context object. Additional classes derived from CDC encapsulate specialized device-context functionality, including support for Windows metafiles.


The base class for device contexts. Used directly for accessing the whole display and for accessing nondisplay contexts such as printers.


A display context used in OnPaint member functions of windows. Automatically calls BeginPaint on construction and EndPaint on destruction.


A display context for client areas of windows. Used, for example, to draw in an immediate response to mouse events.


A display context for entire windows, including both the client and nonclient areas.


A device context for Windows metafiles. A Windows metafile contains a sequence of graphics device interface (GDI) commands that can be replayed to create an image. Calls made to the member functions of a CMetaFileDC are recorded in a metafile.


Holds coordinate (x, y) pairs.


Holds distance, relative positions, or paired values.


Holds coordinates of rectangular areas.


Encapsulates a GDI region for manipulating an elliptical, polygonal, or irregular area within a window. Used in conjunction with the clipping member functions in class CDC.


Displays and handles the user interface for resizing and moving rectangular objects.


Provides a standard dialog box for selecting a color.


Provides a standard dialog box for selecting a font.


Provides a standard dialog box for printing a file.