GetForegroundWindow
Jump to navigation
Jump to search
Description
Retrieves a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.
Keyloggers commonly use this function to determine in which window the user is entering his keystrokes.
Syntax
HWND WINAPI GetForegroundWindow(void);
Parameters
This function has no parameters.
Return value
Type:
Type: HWND
The return value is a handle to the foreground window. The foreground window can be NULL in certain circumstances, such as when a window is losing activation.