Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop a process programmatically

I would like to ask how can I stop a process programmatically using C++?

Thanks.

like image 332
Vibz Avatar asked Sep 11 '26 03:09

Vibz


2 Answers

This is a platform dependent question. Could you specify the platform you're worknig on?

For Windows you can use TerminateProcess

  • http://msdn.microsoft.com/en-us/library/ms686714(VS.85).aspx
like image 87
JaredPar Avatar answered Sep 12 '26 23:09

JaredPar


It's platform-dependent. On Unix you'd send the process a signal with the kill(2).

like image 33
Nikolai Fetissov Avatar answered Sep 12 '26 23:09

Nikolai Fetissov