-Uygulama için gerekli olan nesneler;--
- Listbox-
[*]Textbox-
[*]Button-
Kod:
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.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("user32.dll")]
static extern IntPtr FindWindow(string windowClass, string windowName);
[DllImport("user32.dll")]
static extern bool SetWindowText(IntPtr hWnd, string text);
private **** button1_Click(object sender, EventArgs e)
{
try
{
SetWindowText(FindWindow(null, listBox1.GetItemText(listBox1.SelectedItem)), textBox1.Text);
listBox1.Items.Clear();
listele();
}
catch{
MessageBox.Show("Bir hata oluştu.","HATA",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
**** listele() {
Process[] processlist = Process.GetProcesses();
foreach (Process theprocess in processlist)
{
if (theprocess.MainWindowTitle != "")
{
listBox1.Items.Add(theprocess.MainWindowTitle);
}
}
}
private **** Form1_Load(object sender, EventArgs e)
{
listele();
}
}
}

