how to rerun a process when it was terminated?
-
hi everybody! i have a problem by follow! for example, a.exe was running , now i terminate it by use the windows taskmanager, how to rerun a.exe when it was terminate by c/c++ code.
-
hi everybody! i have a problem by follow! for example, a.exe was running , now i terminate it by use the windows taskmanager, how to rerun a.exe when it was terminate by c/c++ code.
just refer [^]
Величие не Бога может быть недооценена.
-
hi everybody! i have a problem by follow! for example, a.exe was running , now i terminate it by use the windows taskmanager, how to rerun a.exe when it was terminate by c/c++ code.
check with TerminateProcess Function http://msdn.microsoft.com/en-us/library/ms686714%28VS.85%29.aspx[^] How To Terminate an Application "Cleanly" in Win32 http://support.microsoft.com/kb/178893[^]
Thanks and Regards, Selvam, http://www.wincpp.com
-
hi everybody! i have a problem by follow! for example, a.exe was running , now i terminate it by use the windows taskmanager, how to rerun a.exe when it was terminate by c/c++ code.
Probably you need another process monitoring the original one. The monitoring process may, for instance, poll every, say
10
seconds, for the original process status and launch it again when needed. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
hi everybody! i have a problem by follow! for example, a.exe was running , now i terminate it by use the windows taskmanager, how to rerun a.exe when it was terminate by c/c++ code.
Could you elaborate a bit further? You want to restart a program that was deliberately terminated via Task Manager by a user?
-
Probably you need another process monitoring the original one. The monitoring process may, for instance, poll every, say
10
seconds, for the original process status and launch it again when needed. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]I once battled a "virus" that employed such a scheme. It polled every second, however. Delete A and B would start it back up. Delete B and A would start it back up.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
I once battled a "virus" that employed such a scheme. It polled every second, however. Delete A and B would start it back up. Delete B and A would start it back up.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
Well, I suppose it maybe a schema for some viruses. It is also a rather obvious mechanism (at least I hope...). :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Could you elaborate a bit further? You want to restart a program that was deliberately terminated via Task Manager by a user?
yes,and must use c/c++ code to restart.
-
Probably you need another process monitoring the original one. The monitoring process may, for instance, poll every, say
10
seconds, for the original process status and launch it again when needed. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]how to check the original process is live by the process's name?
-
how to check the original process is live by the process's name?
Finding a process by name is a rather lenghty operation (you must go through
EnumWindows
[^]). Perhaps a better option would be storing the process handle (if applicationA
starts applicationB
viaCreateProcess
[^] thenA
may store theB
process handle) and callGetExitCodeProcess
[^] when needed. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]