User32SetForegroundWindow(IntPtr) Method

Brings 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.

The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static bool SetForegroundWindow(
	IntPtr hWnd
)

Parameters

hWnd  IntPtr
A IntPtr handle to the window that should be activated and brought to the foreground.

Return Value

Boolean
If the window was brought to the foreground, the return value is . If the window was not brought to the foreground, the return value is .

Remarks

See Also