Hello everyone!
I am fairly new to C++ programming, and would appreciate help. I would like to know some functions for altering other programs, mostly commands to stop a program from running and commands to start running a program. Thank you!
Hello everyone!
I am fairly new to C++ programming, and would appreciate help. I would like to know some functions for altering other programs, mostly commands to stop a program from running and commands to start running a program. Thank you!
Hi,
for starting use http://en.wikipedia.org/wiki/System_...ard_Library%29
for stopping: do we speak of stopping programs you wrote, or stopping other programs generally?
in the first case you want to communicate to the other program somehow, through filesystem or network connection for example. the other program listen to that and ends itself.
in the second case you have to use os-dependent things. on linux you can send signals to every process (term or kill for example) . I guess on win32 does exist a similar mechanism.
Last edited by pheres; 08-06-2007 at 12:51 AM.
In windows you can use "TerminateProcess" - but you either need to administrator rights or the same user that started the process.
Note that I don't think this is the same as what you are asking for - a method to stop a program from running is usually a "Security setting" for the user (e.g. a user with administrator rights/root privilege can run application A, but regular user's cant. Application B can be run by anyone who belongs to a certain group - there are more complicated variations as well)- and that is also OS-dependant (that is, it works differently in Linux than it does in Windows), and I don't know much about how you access any of that functioanality in C/C++.
This of course has no relation to C or C++ - the functionality is part of the OS, and unrelated to the language being used.
--
Mats