handle get_device_context(handle window)

This function obtains a device context for the client area of a window or for the entire screen.


handle window

The handle of the window for which a device context is required. If null is specified, a device context for the entire screen is obtained.



The handle of the new device context or null if an error occurred.


This function obtains:

The type of device context that is obtained depends upon the class style of the window. Common device contexts are assigned default attributes each time one is obtained. Previous attributes are assigned unchanged to class and private device contexts.

After painting with a common device context, the function release_device_context should be called. Class and private device contexts do not have to be released.