Esempio n. 1
0
 public bool Create(
     string lpApplicationName,
     string lpCommandLine,
     IntPtr lpProcessAttributes,
     IntPtr lpThreadAttributes,
     bool bInheritHandles,
     uint dwCreationFlags,
     IntPtr lpEnvironment,
     string lpCurrentDirectory,
     [In] ref Startupinfo lpStartupInfo,
     out ProcessInformation lpProcessInformation
     )
 {
     return(WinApiFuncs.CreateProcess(
                lpApplicationName,
                lpCommandLine,
                lpProcessAttributes,
                lpThreadAttributes,
                bInheritHandles,
                dwCreationFlags,
                lpEnvironment,
                lpCurrentDirectory,
                ref lpStartupInfo,
                out lpProcessInformation
                ));
 }
Esempio n. 2
0
        public ProcessInformation Create(string commandLine)
        {
            ProcessInformation pi;
            Startupinfo        si = new Startupinfo();

            si.cb = Marshal.SizeOf(si);
            IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1);

            if (this._process.Create(
                    null,
                    commandLine,
                    IntPtr.Zero,
                    IntPtr.Zero,
                    false,
                    0,
                    IntPtr.Zero,
                    null,
                    ref si,
                    out pi
                    )
                )
            {
                return(pi);
            }
            else
            {
                return new ProcessInformation {
                           hProcess = INVALID_HANDLE_VALUE, hThread = INVALID_HANDLE_VALUE
                }
            };
        }
    }
Esempio n. 3
0
 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
     );