AllAPI Network - The KPD-Team

Allapi Network

 API List

API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
This Site
 Search Engine
 Contact Form

Donate to


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

Declare Function SetFocus 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


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.


Related Functions



Copyright © 1998-2007, The Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at