using System . Diagnostics;
using System . Runtime . InteropServices;
[ DllImport ( "user32.dll" )]
public static extern bool SetForegroundWindow( IntPtr hWnd);
private void button1_Click( object sender , EventArgs e)
{
Process [] vProcesses = Process . GetProcessesByName( "calc" );
if (vProcesses . Length <= 0 )
Process . Start( "calc.exe" );
else SetForegroundWindow(vProcesses[ 0 ] . MainWindowHandle);
}