The methods listed below are used to retrieve and release a device context.
A device context is associated with a window, a dialog, or a push button, and is a drawing area managed by a window. A device context stores information about the graphic objects (bitmaps, lines, pixels, ...) that are displayed and the tools (pen, brush, font, ...) that are used to display them.
>>-aBaseDialog~GetWindowDC(--hwnd--)--------------------------><
The GetWindowDC method returns the device context of a window. Do not forget to free the device context after you have completed the operations (see FreeWindowDC).
The only argument is:
The handle of the window
>>-aBaseDialog~GetButtonDC(--id--)----------------------------><
The GetButtonDC method returns the device context of a button. Do not forget to free the device context after you have completed the operations (see FreeButtonDC).
The only argument is:
The ID of the button
>>-aBaseDialog~FreeWindowDC(--hwnd--,--dc--)------------------><
The FreeWindowDC method frees the device context of a window.
The arguments are:
The window handle
The device context previously received by the GetWindowDC method
>>-aBaseDialog~FreeButtonDC(--id--,--dc--)--------------------><
The FreeButtonDC method releases the device context of a button.
The arguments are:
The ID of the button
The device context previously received by the GetButtonDC method