SamiN
New member
- Joined
- Sep 6, 2020
- Messages
- 4
- Programming Experience
- Beginner
Hello, I was looking for a code can get the names of all opened windows and got this one:
this code works perfectly but l need to show the result of the console into the form, I ask if the code can be added to or converted into a code under a button in c# windows form application.
C#:
using System.Diagnostics;
Process[] processlist = Process.GetProcesses();
foreach (Process process in processlist)
{
if (!String.IsNullOrEmpty(process.MainWindowTitle))
{
Console.WriteLine("Process: {0} ID: {1} Window title: {2}", process.ProcessName, process.Id, process.MainWindowTitle);
}
}
Last edited: