Access running process.

  • Thread starter Thread starter fireloard
  • Start date Start date
F

fireloard

I have console application open running that you need to press Escape
on to get it to exit. Usually once a day/week etc I want to close that
process and start it again. Is there any way to find a process running
on a machine and send a command to it from a c# app? I don't think this
application was written in .net so it wouldn't be managed code.
 
You might want to try the SendKeys class. It will allow you to send a
character sequence to the active application.

Ideally though, you would re-write this app to be a service, and then
send a pause or stop command to the service, and then just start it back up.

Hope this helps.
 
see inline

Willy.

Nicholas Paldino said:
You might want to try the SendKeys class. It will allow you to send a
character sequence to the active application.

Don't think SendKeys can be used to send key sequences to console program.

Ideally though, you would re-write this app to be a service, and then
send a pause or stop command to the service, and then just start it back
up.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I have console application open running that you need to press Escape
on to get it to exit. Usually once a day/week etc I want to close that
process and start it again. Is there any way to find a process running
on a machine and send a command to it from a c# app? I don't think this
application was written in .net so it wouldn't be managed code.
 
Back
Top