Sign in Join
FPDoc Onlineexperiment

TControlCanvas.FreeHandle procedure

Member of TControlCanvaspublicIn unit Controls

Frees the Handle for the control canvas, and its device context when assigned.

Declaration

pascal
procedure FreeHandle; override

Description

FreeHandle is an overridden method in TControlCanvas. It calls the inherited method on entry to set the value in Handle to 0 (the unassigned value). If a device context (DC) has been allocated for the window handle (HWND), the ReleaseDC routine is called to release the device context.

FreeHandle MUST be called when the Handle for a control which uses a canvas instance is destroyed/released. For windowed controls this generally occurs in the DestroyWnd method. For non-windowed controls this occurs when the parent window handle is freed.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.