Overview
Group
Quick Info

Windows NT
Yes
Win95
Yes
Win32s
Yes
Import Library
user32.lib
Header File
winuser.h
Unicode
No
Platform Notes
None

GetFocus

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.

HWND GetFocus(VOID)

Parameters

This function has no parameters.

Return Values

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.

Remarks

Even if GetFocus returns NULL, another thread's queue may be associated with a window that has the keyboard focus.

Use the GetForegroundWindow function to retrieve the handle to the window with which the user is currently working. You can associate your thread's message queue with the windows owned by another thread by using the AttachThreadInput function.

See Also

AttachThreadInput
, GetForegroundWindow, SetFocus, WM_KILLFOCUS, WM_SETFOCUS

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database