[DllImport("CoreDLL.dll", SetLastError=true)]
static extern bool GetExitCodeProcess(IntPtr Handle, out uint Wait);
Declare Function GetExitCodeProcess Lib "CoreDLL.dll" (TODO) As TODO
None.
Do you know one? Please contribute it!
http://netcf2.blogspot.com/2006/01/msmq-message-queueing-in-compact.html
Please add some!
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;
}
}