public static ProcessInfo Create(
            string applicationName,
            string arguments)
        {
            var startupInfo = new StartupInfo();
            var sec = new SecurityAttributes();
            sec.nLength = sec.Size;
            ProcessInformation processInfo;

            const ProcessCreationFlags CreateFlags =
                ProcessCreationFlags.CREATE_NO_WINDOW
                | ProcessCreationFlags.CREATE_SUSPENDED;

            if (true == CreateProcess(
                    applicationName,
                    arguments,
                    ref sec,
                    ref sec,
                    false,
                    (uint)CreateFlags,
                    IntPtr.Zero,
                    null,
                    ref startupInfo,
                    out processInfo))
            {

                return new ProcessInfo(
                    Process.GetProcessById(processInfo.dwProcessId),
                    processInfo);
            }

            return null;
        }
        public static ProcessInfo Create(
            string applicationName,
            string arguments)
        {
            var startupInfo = new StartupInfo();
            var sec         = new SecurityAttributes();

            sec.nLength = sec.Size;
            ProcessInformation processInfo;

            const ProcessCreationFlags CreateFlags =
                ProcessCreationFlags.CREATE_NO_WINDOW
                | ProcessCreationFlags.CREATE_SUSPENDED;

            if (true == CreateProcess(
                    applicationName,
                    arguments,
                    ref sec,
                    ref sec,
                    false,
                    (uint)CreateFlags,
                    IntPtr.Zero,
                    null,
                    ref startupInfo,
                    out processInfo))
            {
                return(new ProcessInfo(
                           Process.GetProcessById(processInfo.dwProcessId),
                           processInfo));
            }

            return(null);
        }
 private static extern bool CreateProcess(
     string lpApplicationName,
     string lpCommandLine,
     ref SecurityAttributes lpProcessAttributes,
     ref SecurityAttributes lpThreadAttributes,
     bool bInheritHandles,
     uint dwCreationFlags,
     IntPtr lpEnvironment,
     string lpCurrentDirectory,
     [In] ref StartupInfo lpStartupInfo,
     out ProcessInformation lpProcessInformation);
 private static extern bool CreateProcess(
     string lpApplicationName,
     string lpCommandLine,
     ref SecurityAttributes lpProcessAttributes,
     ref SecurityAttributes lpThreadAttributes,
     bool bInheritHandles,
     uint dwCreationFlags,
     IntPtr lpEnvironment,
     string lpCurrentDirectory,
     [In] ref StartupInfo lpStartupInfo,
     out ProcessInformation lpProcessInformation);