UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | req.apiset | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:winuser.SetActiveWindow |
SetActiveWindow function (winuser.h) |
Activates a window. The window must be attached to the calling thread's message queue. |
|
inputdev\setactivewindow.htm |
inputdev |
VS|winui|~\winui\windowsuserinterface\userinput\keyboardinput\keyboardinputreference\keyboardinputfunctions\setactivewindow.htm |
12/05/2018 |
SetActiveWindow, SetActiveWindow function [Keyboard and Mouse Input], _win32_SetActiveWindow, _win32_setactivewindow_cpp, inputdev.setactivewindow, winui._win32_setactivewindow, winuser/SetActiveWindow |
winuser.h |
Windows.h |
Windows |
Windows 2000 Professional [desktop apps only] |
Windows 2000 Server [desktop apps only] |
User32.lib |
User32.dll |
Windows |
19H1 |
|
|
|
|
|
|
ext-ms-win-ntuser-window-l1-1-4 (introduced in Windows 10, version 10.0.14393) |
Activates a window. The window must be attached to the calling thread's message queue.
Type: HWND
A handle to the top-level window to be activated.
Type: HWND
If the function succeeds, the return value is the handle to the window that was previously active.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
The SetActiveWindow function activates a window, but not if the application is in the background. The window will be brought into the foreground (top of Z-Order) if its application is in the foreground when the system activates the window.
If the window identified by the hWnd parameter was created by the calling thread, the active window status of the calling thread is set to hWnd. Otherwise, the active window status of the calling thread is set to NULL.
Conceptual
Reference