A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



Putfocus

The PutFocus function sets the keyboard focus to the specified window. The window must be associated with the calling thread’s message queue.

VB4-32,5,6
Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long

Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later

Library
User32

Parameter Information
- hWnd
Identifies the window that will receive the keyboard input. If this parameter is NULL, keystrokes are ignored.

Return Values
If the function succeeds, the return value is the handle of the window that previously had the keyboard focus. If the hWnd parameter is invalid or the window is not associated with the calling thread’s message queue, the return value is NULL.

Last update: 07 April 2006