Display Contexts and Device Contexts

A display context is actually a type of “device context” that has been especially prepared for output to the client area of a window. A device context defines the device, drawing tools, and drawing information for a complete device, such as a display or printer; a display context defines these things only for a window's client area. To prepare a display context, Windows adjusts the device origin so that it aligns with the upper-left corner of the client area instead of with the upper-left corner of the display. It also sets a clipping rectangle so that output to a display context is “clipped” to the client area. This means any output that would otherwise appear outside the client area is not sent to the display.