You can use interop service fot solve your request.
using System.Runtime.InteropServices;
public partial class FormMain : Form
{
enum SetWinPos_ZOrderOpt{HWND_TOP = 0,
HWND_BOTTOM = 1,
HWND_TOPMOST = -1,
HWND_NOTOPMOST = -2}
enum SetWinPosFlags
{
SWP_NOSIZE = 0x0001,
SWP_NOMOVE = 0x0002,
SWP_NOZORDER = 0x0004,
SWP_NOREDRAW = 0x0008,
SWP_NOACTIVATE = 0x0010,
SWP_FRAMECHANGED = 0x0020,
SWP_SHOWWINDOW = 0x0040,
SWP_HIDEWINDOW = 0x0080,
SWP_NOCOPYBITS = 0x0100,
SWP_NOOWNERZORDER = 0x0200,
SWP_NOSENDCHANGING = 0x0400,
SWP_DRAWFRAME = SWP_FRAMECHANGED,
SWP_NOREPOSITION = SWP_NOOWNERZORDER
}
[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern IntPtr SetWindowPos(int hWnd, int hWndInsertAfter,
int X, int Y, int cx, int cy,
uint flages);
private void buttonTestTopLevel_Click(object sender, EventArgs e)
{
Process myProcess = new Process();
try
{
this.TopMost = false;
string winpath = Environment.GetEnvironmentVariable("windir");
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.FileName = winpath + @"\system32\notepad.exe";
myProcess.Start();
myProcess.WaitForInputIdle();
{
SetWindowPos(myProcess.MainWindowHandle.ToInt32(),
(int)SetWinPos_ZOrderOpt.HWND_TOPMOST,
0, 0, 0, 0,
(int)(SetWinPosFlags.SWP_NOSIZE |
SetWinPosFlags.SWP_NOMOVE |
SetWinPosFlags.SWP_SHOWWINDOW));
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
Note 1:
Here you can end in problems in case your app is 32bit and Win is 64bit.
I hope it helps.