The GetFocus function retrieves the handle of the window that has the keyboard focus, if the window is associated with the calling threadís message queue.
Declare Function GetFocus Lib "user32" Alias "GetFocus" () As Long
|Operating Systems Supported|
|Requires Windows NT 3.1 or later; Requires Windows 95 or later|
|If the function succeeds, the return value is the handle of the window with the keyboard focus. If the calling threadís message queue does not have an associated window with the keyboard focus, the return value is NULL. |