using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); Thread thread = new Thread(bLend); thread.Start(); } [DllImport("user32.dll")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); private void bLend() { Thread.Sleep(2000); Process.Start(@"App\bLend.exe"); Thread.Sleep(50); IntPtr hWnd = FindWindow(null, "bLend Preferences.."); if (hWnd != IntPtr.Zero) ShowWindow(hWnd, 0); Thread.Sleep(1000); Environment.Exit(0); } } }