Kód v c#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Runtime.InteropServices; namespace WindowsFormsApplication1 { public partial class Form1 : Form { [DllImportAttribute("User32.dll")] private static extern int ShowWindow(int hwnd, int nCmdShow); [DllImport("User32.dll")] public static extern Int32 SetForegroundWindow(int hWnd); public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { var listprocess = Process.GetProcesses(); foreach (var p in listprocess) { if (p.ProcessName == "notepad") { var hWnd = p.MainWindowHandle; SetForegroundWindow((int)hWnd); ShowWindow((int)hWnd, 1); this.TopMost = false; } } } } }