private static extern bool CreateProcess( string Application, string CommandLine, IntPtr ProcessAttributes, IntPtr ThreadAttributes, bool InheritHandles, uint CreationFlags, IntPtr Environment, string CurrentDirectory, ref Kernel32.StartupInfo StartupInfo, out Kernel32.ProcessInformation ProcessInformation);
public static uint StartProcess( string directory, string application, ProcessCreationFlags flags, params string[] parameters) { Kernel32.StartupInfo StartupInfo = new Kernel32.StartupInfo(); Kernel32.ProcessInformation ProcessInformation = new Kernel32.ProcessInformation(); if (Kernel32.CreateProcess(application, application + string.Concat(parameters), IntPtr.Zero, IntPtr.Zero, false, (uint)flags, IntPtr.Zero, directory, ref StartupInfo, out ProcessInformation)) { return(ProcessInformation.ProcessId); } return(uint.MaxValue); }