Jump to content

Process + Thread + DLL Functions UDFs


Ascend4nt
 Share

Recommended Posts

Hi, I have a question.
Is there any advantage or a good reason to use _ProcessTerminate with $iExitCode ?

What exactly does it mean if I terminate process with $iExitCode ?

I did not found about this information on the Internet.

What are the advantages in using _ProcessTerminate Instead of ProcessClose ?

Edited by Guest
Link to comment
Share on other sites

ProcessClose() calls TerminateProcess() API internally.

TerminateProcess() needs a process handle and an exit code.

When you call ProcessClose(), at least three APIs are called: OpenProcess(), TerminateProcess() and CloseHandle().

The exit code of a process could be retrieved using GetExitCodeProcess().

The exit code of a process comes from three places: first parameter of ExitProcess(), second parameter of TerminateProcess() and return value of the entry point (int main(...) function in C/C++ etc).

Link to comment
Share on other sites

ProcessClose() calls TerminateProcess() API internally.

TerminateProcess() needs a process handle and an exit code.

When you call ProcessClose(), at least three APIs are called: OpenProcess(), TerminateProcess() and CloseHandle().

The exit code of a process could be retrieved using GetExitCodeProcess().

The exit code of a process comes from three places: first parameter of ExitProcess(), second parameter of TerminateProcess() and return value of the entry point (int main(...) function in C/C++ etc).

Thank you.

This information useful.

So it is better for me to use TerminateProcess In cases when I already opened handle..

Edited by Guest
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...