User32SetForegroundWindow(SafeHandle) 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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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(
SafeHandle hWnd
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function SetForegroundWindow (
hWnd As SafeHandle
) As Boolean
Dim hWnd As SafeHandle
Dim returnValue As Boolean
returnValue = User32.SetForegroundWindow(hWnd)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static bool SetForegroundWindow(
SafeHandle^ hWnd
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member SetForegroundWindow :
hWnd : SafeHandle -> bool
No code example is currently available or this language may not be supported.
- hWnd SafeHandle
-
A IntPtr handle to the window that should be activated and brought to the foreground.
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
.