//NOTE: For Win32 Applications you can use [DllImport("User32.dll")] for this functionality
[DllImport("coredll.dll")]
private static extern bool SetForegroundWindow (IntPtr hWnd);
Private Declare Function SetForegroundWindow Lib "coredll" (hWnd as IntPtr) As Boolean
None.
http://www.pinvoke.net/default.aspx/user32/SetForegroundWindow.html
Do you know one? Please contribute it!
None.
If the window being set to the foreground is minimized, the window may not be visible to the end user. This function also does not reactivate the last active child window by default. To ensure that the window is restored and the last active child window is reactivated, combine the handle to the window with 0x01 using the logical OR operator
E.g. SetForegroundWindow((HWND)(((ULONG) hwnd) | 0x01) );
[DllImport ("coredll.dll")]
private static extern bool SetForegroundWindow (IntPtr hWnd);
[DllImport ("coredll.dll")]
private static extern IntPtr GetDesktopWindow ();
private void SendToBack ()
{
SetForegroundWindow (GetDesktopWindow ());
}