Click here to Skip to main content
15,887,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm using the System.Diagnostics.Process class in C#.
Is it possible to pause a process (not my process, but another) and then continue it with this class or with another class?
If possible, how to do that?

Thanks in advance.
Posted
Updated 21-Oct-12 4:40am
v3

1 solution

For obvious reasons, you can't resume a suspended process from within the process itself...

The recommended way would be to use a Mutex: Mutex.WaitOne[^] - this includes a version that will "wake up" after a specified number of milliseconds.
 
Share this answer
 
Comments
Thomas Daniels 21-Oct-12 10:33am    
I think your solution is to suspend your own process.
But I need to suspend/continue another process, not mine.
OriginalGriff 21-Oct-12 10:38am    
:laugh: Then you should ask that!
Have a look at this: http://stackoverflow.com/questions/71257/suspend-process-in-c-sharp
It uses Kernel32 to do just that.
Thomas Daniels 21-Oct-12 10:40am    
Thanks!
I thought I asked to suspend another process with my text "pause a process".
A very good solution, +5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900