[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TControl.GetDeviceContext

Returns a device context handle for the control, from Parent.

## Declaration

Source position: controls.pp line 1530

`protected function TControl.GetDeviceContext(`
`var WindowHandle: HWND`
`):HDC; virtual;`

## Arguments

`WindowHandle` |  | Returns the window handle of the device context.

## Function result

The device context.

## Description

Initializes the device context position to the control origin, and shrinks its clipping rectangle to the bounds for the control.