2.1.3 Device-Context Functions

Device-context functions create, delete, and restore device contexts. Following are the GDI device-context functions:

Function Description

CreateCompatibleDC Creates a memory device context.
CreateDC Creates a device context.
CreateIC Creates an information context.
DeleteDC Deletes a device context.
GetDCOrg Retrieves the origin of a specified device context.
ResetDC Updates a device context.
RestoreDC Restores a device context.
SaveDC Saves the current state of the device context.

In addition, applications can use the following functions in the USER API to retrieve and release device contexts:

Function Description

BeginPaint Prepares a window for painting, fills a buffer with information about the painting, and retrieves a handle of a device context.
GetDC Retrieves the handle of a device context for the client area of the given window.
GetWindowDC Retrieves a device context for an entire window, including title bar, menus, and scroll bars.
ReleaseDC Releases a device context, freeing it for use by other applications.

For more information about these USER functions, see Chapter 1, “Window Management.”