From within a program, can you stop a completely outside program and later "restart" it

Hello,

Do you have complete example code that demonstrates in someway to stop an external program using only it's PID and name or something, and later restart the exact same program?

I want to stop a program that is running on the computer. The program I want to stop is not running because of my program. I have the external running program's PID and name.

The main thing that I want to do is be able to restart the program that I stopped from within my program.

I currently don't know where the executable that I want to restart is on my computer.

Mike
Last edited on
Try DebugActiveProcess
https://docs.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-debugactiveprocess

Of course if you were on Unix it's just kill(pid, SIGSTOP)
Last edited on
Topic archived. No new replies allowed.