Process _winMergeProc = Process.Start("WinMerge", args);
BringProcessToFront(_winMergeProc);
----
const int SW_RESTORE = 9;
private static void BringProcessToFront(Process process)
{
var hWnd = process.MainWindowHandle;
if (IsIconic(hWnd))
ShowWindow(hWnd, SW_RESTORE);
SetForegroundWindow(hWnd);
}
[DllImport("User32.dll")]
private static extern bool SetForegroundWindow(IntPtr handle);
[DllImport("User32.dll")]
private static extern bool ShowWindow(IntPtr handle, int nCmdShow);
[DllImport("User32.dll")]
private static extern bool IsIconic(IntPtr handle);