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

# TWidgetSet.SetFocus

Sets the keyboard input focus to the specified window.

## Declaration

Source position: winapih.inc line 246

`public function TWidgetSet.SetFocus(`
`hWnd: HWND`
`):HWND; virtual;`

## Arguments

`hWnd` |  | The handle of the window receiving the focus.

## Function result

The handle of the previously focused window, zero if none.