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

TWidgetSet.RedrawWindow

Redraws (part of) a window.

Declaration

Source position: winapih.inc line 222

public function TWidgetSet.RedrawWindow(

  Wnd: HWND;

  lprcUpdate: PRect;

  hrgnUpdate: HRGN;

  flags: UINT

):Boolean; virtual;

Arguments

Wnd

  

The window to redraw.

lprcUpdate

  

The rectangle to redraw, ignored when a region is given.

hrgnUpdate

  

The region to redraw, can be zero.

flags

  

How the redraw works.

Function result

False on failure.

Description

All invalidated parts of a window, which deserve an update, are collected in the update region. When this region is not empty, WM_ERASEBKGND, WM_PAINT and WM_NCPAINT messages are sent to the window, as soon as the application is (almost) idle. RedrawWindow can be used to force an immediate redraw instead.

WM_ERASEBKGND is optional, erases the background before painting. WM_NCPAINT paints the non-client areas (borders, caption...), without assistance by user code.

When neither lprcUpdate nor hrgnUpdate are specified, the whole client area of the window is affected. Otherwise the region takes precedence over the rectangle.

Flags specify how the window is invalidated or validated, and when repainting occurs. Flags other than RDW_ERASE may not be supported by all platforms.

To invalidate specify RDW_INVALIDATE, and optionally one of:

Validation is not implemented for all platforms. To validate specify RDW_VALIDATE, and optionally one of:

These flags specify when repainting will occur:

The handling of child windows normally depends on the WS_CLIPCHILDREN window style flag. Clipped child windows are not normally affected by RedrawWindow. These flags override:

See also

TWidgetSet.InvalidateRect

  

Marks a display area for repaint.

TWidgetSet.InvalidateRgn

  

Marks a display area for repaint.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.