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

# TWidgetSet.SetCapture

Sets the mouse capture to the specified window.

## Declaration

Source position: winapih.inc line 241

`public function TWidgetSet.SetCapture(`
`AHandle: HWND`
`):HWND; virtual;`

## Arguments

`AHandle` |  | The handle of the capturing window.

## Function result

The handle of the previous capture window, zero if none.

## Description

The window will receive all mouse messages, until capture is released again.

## See also

TWidgetSet.ReleaseCapture |  | Restores normal mouse input processing, after SetCapture.