public static ProcessInformation CreateProcess(string lpCommandLine, uint dwCreationFlags = 0) { ProcessInformation pi; var si = new Startupinfo(); si.cb = Marshal.SizeOf(si); var ret = CreateProcess(null, lpCommandLine, IntPtr.Zero, IntPtr.Zero, false, dwCreationFlags, IntPtr.Zero, null, ref si, out pi); return(ret ? pi : new ProcessInformation { hProcess = INVALID_HANDLE_VALUE, hThread = INVALID_HANDLE_VALUE }); }
public static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [In] ref Startupinfo lpStartupInfo, out ProcessInformation lpProcessInformation);