Device Context Methods

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.

GetWindowDC

>>-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).

Arguments:

The only argument is:

hwnd

The handle of the window

GetButtonDC

>>-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).

Arguments:

The only argument is:

id

The ID of the button

FreeWindowDC

>>-aBaseDialog~FreeWindowDC(--hwnd--,--dc--)------------------><


The FreeWindowDC method frees the device context of a window.

Arguments:

The arguments are:

hwnd

The window handle

dc

The device context previously received by the GetWindowDC method

FreeButtonDC

>>-aBaseDialog~FreeButtonDC(--id--,--dc--)--------------------><


The FreeButtonDC method releases the device context of a button.

Arguments:

The arguments are:

id

The ID of the button

dc

The device context previously received by the GetButtonDC method