/// <summary> /// Active Windows Title /// </summary> /// <param name="title"></param> private void ActiveProcess(string title) { Process[] processes = Process.GetProcesses(); int windowHandle = 0; foreach (Process p in processes) { if (p.MainWindowTitle.Contains(title)) { windowHandle = (int)p.MainWindowHandle; break; } } NativeWin32.SetForegroundWindow(windowHandle); }
private void ActiveWindows(string title) { int windowHandle = NativeWin32.FindWindow(null, title); NativeWin32.SetForegroundWindow(windowHandle); }