SetForegroundWindow (coredll)
Last changed: -41.196.238.118

.
Summary
SetForegroundWindow() - Moves the window associated with the passed handle to the front.

C# Signature:

[DllImport("coredll.dll"]
private static extern bool SetForegroundWindow (IntPtr hWnd);

VB Signature:

Declare Function SetForegroundWindow Lib "coredll.dll" (hWnd as IntPtr) As bool

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

[DllImport ("coredll")]
private static extern bool SetForegroundWindow (IntPtr hWnd);

[DllImport ("coredll")]
private static extern IntPtr GetDesktopWindow ();

private void SendToBack ()
{
    SetForegroundWindow (GetDesktopWindow ());
}

Documentation