How do I get a process?

Feb 26, 2010 at 9:39 AM

Can I use Application.Attach(...) to get a new application object without launching the application while it's already running?

Feb 26, 2010 at 10:33 AM

yes

 

to do so:

 

Process[] myProcess = Process.GetProcessesByName( "MyProcess" );

 

Application app = Application.Attach(myProcess[0]);

 

you can also use the processid Application.Attach(processId);

 

or the name of the executable but I prefer the first version

 

Throndorin