Export (0) Print
Expand All
8 out of 19 rated this helpful - Rate this topic

GetActiveWindow function

Retrieves the window handle to the active window attached to the calling thread's message queue.

Syntax


HWND WINAPI GetActiveWindow(void);

Parameters

This function has no parameters.

Return value

Type: HWND

The return value is the handle to the active window attached to the calling thread's message queue. Otherwise, the return value is NULL.

Remarks

To get the handle to the foreground window, you can use GetForegroundWindow.

To get the window handle to the active window in the message queue for another thread, use GetGUIThreadInfo.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
GetForegroundWindow
GetGUIThreadInfo
SetActiveWindow
Conceptual
Keyboard Input

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.