GetExitCodeProcess (coredll)
Last changed: -211.5.245.142

.
Summary
TODO - a short description

C# Signature:

[DllImport("CoreDLL.dll", SetLastError=true)]
static extern bool GetExitCodeProcess(IntPtr Handle, out uint Wait);

VB Signature:

Declare Function GetExitCodeProcess Lib "CoreDLL.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

http://netcf2.blogspot.com/2006/01/msmq-message-queueing-in-compact.html

Tips & Tricks:

Please add some!

Sample Code:

private main(){

    ProcessInfo pi = new ProcessInfo();
    uint ret;
    CreateProcessWait("calc.exe", "", pi, out ret)

}

private static bool CreateProcessWait( String ExeName, String CmdLine, ProcessInfo pi, out uint retCode ){

    Int32 INFINITE;
    int intRet;
    unchecked {INFINITE = (int)0xFFFFFFFF;}
    retCode = 0;

    if ( pi == null ){
    pi = new ProcessInfo();
    }
    byte [] si = new byte[128];
    intRet= CreateProcessAPI(ExeName, CmdLine, IntPtr.Zero, IntPtr.Zero,
    0, 0, IntPtr.Zero, IntPtr.Zero, si, pi);

    WaitForSingleObject(pi.hProcess, INFINITE);
    uint ExitCode;
    if(GetExitCodeProcess(pi.hProcess, out ExitCode) == true){
    // getRetValue
    }
    CloseHandle(pi.hProcess);
    CloseHandle(pi.hThread);
    if(intRet == 0){
    return false;
    }else{
    return true;
    }

}

Documentation