SetForegroundWindow
The SetForegroundWindow
function puts the thread that created the specified window into the foreground
and activates the window. Keyboard input is directed to the window, and various
visual cues are changed for the user.
BOOL SetForegroundWindow(
HWND hWnd |
// handle of window
to bring to foreground |
); |
|
Parameters
hWnd
Identifies
the window that should be activated and brought to the foreground.
Return Values
If the
function succeeds, the return value is nonzero.
If the
function fails, the return value is zero. To get extended error information,
call GetLastError
Remarks
The foreground
window is the window at the top of the Z order
The system
assigns a slightly higher priority to the thread that created the foreground
window than it does to other threads.
See Also