Link to home
Start Free TrialLog in
Avatar of maxemillion_max
maxemillion_max

asked on

hOw to provide exit code to ExitProcess()?

Hi,  
    I have created a process using
               
          CreateProcess(,,,,,);

    I will terminate the Process by calling

          ExitProcess(fuExitCode);

     The question is .. how do i get the fuExitCode for funcion ExitProcess()??



Avatar of alikoank
alikoank

If you want to get this exit code from your original process use GetExitCodeProcess function, or if you wonder what should fuExitCode must be, it is up to you.

Programs generally use 0 (zero) as an exit code to indicate that they finished execution normally. You can return any unsigned integer value to indicate errors etc.

For more information look at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/exitprocess.asp
Avatar of maxemillion_max

ASKER

actually i have come to that link already... thanks you..
:) can u give a simple example of using ExitProcess() with GetExitCodeProcess() .... i would appreciate it... because i am stucked when come into  terminating a Process using ExitProcess() function.... I had use TerminateProcess() function before and it worked... however .. it is recommended that TerminateProcess() function oni be used when ExitProcess() function can't be used or won't responding............please advice.. ... THANK YOU :)
ASKER CERTIFIED SOLUTION
Avatar of alikoank
alikoank

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial