Vcl.Controls.TWinControl.GetDeviceContext

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetDeviceContext(var WindowHandle: HWND): HDC; overload; override;

C++

virtual HDC __fastcall GetDeviceContext(HWND &WindowHandle)/* overload */;

Properties

Type Visibility Source Unit Parent
function protected
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TWinControl

Description

Provides access to a device context for the control.

Call GetDeviceContext to obtain a handle to a device context for the control.

GetDeviceContext calls the Windows API function GetDC, passing the windowed control's Handle property. It returns the window's handle in the WindowHandle parameter and the HDC as the return value. If the call is unsuccessful, the EOutOfResources exception is raised.

See Also

Code Examples