Set process object = current app?

  • Thread starter Thread starter james
  • Start date Start date
J

james

Hello,
I would like to instance a new System.Diagnostics.Process object that is the
current application, but I can't see a quick way of doing this. I know how
to "start" a process, but it's already running. Do I really need to iterate
through the collection of processes? And if so, how do I know which is the
one I'm "in" (i.e. the user may have run more than one occurrence)?

Thanks
 
james said:
Hello,
I would like to instance a new System.Diagnostics.Process object that is
the current application, but I can't see a quick way of doing this. I
know how to "start" a process, but it's already running. Do I really need
to iterate through the collection of processes? And if so, how do I know
which is the one I'm "in" (i.e. the user may have run more than one
occurrence)?

System.Diagnostics.Process proc =
System.Diagnostics.Process.GetCurrentProcess();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top