For example, I wanna get handle from browser.
private void button1_Click(object sender, EventArgs e)
{
Process.Start("https://google.com/");
//How to get handle of this process?
}
CodePudding user response:
Process.Start()
returns a Process
object of the newly created process.
In the example below, myProcess.Handle
is going to be the handle of said process.
var myProcess = Process.Start("notepad.exe");
Console.WriteLine(myProcess.Handle);