private void function1()
{
Process[] processlist = Process.GetProcessesByName("my process");
string title = "title";
string procID;
foreach (Process process in processlist)
{
if (String.Equals(process.MainWindowTitle, title))
{
procID = process.Id.ToString();
MessageBox.Show("This is the process ID: " + process.Id);
MessageBox.Show(procID);
}
else
{
MessageBox.Show("Window not found");
}
}
}
using PID in getprocessbyid
Page 1 of 13 Replies - 182 Views - Last Post: 15 January 2013 - 05:29 AM
#1
using PID in getprocessbyid
Posted 09 January 2013 - 07:39 PM
I know how the function works, so I dont need anyone to explain it to me. However, I have multiple applications open with the same exe name but different window titles. I use this code to find the PID based on the window title. Now how do use this with getprocessbyid? Or since it is already returning only the pid from that specific window title, is what im asking unnecessary?
Replies To: using PID in getprocessbyid
#2
Re: using PID in getprocessbyid
Posted 09 January 2013 - 07:45 PM
#3
#4
Re: using PID in getprocessbyid
Posted 15 January 2013 - 05:29 AM
Same for notepad.exe.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote






|