コード例 #1
0
 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);
コード例 #2
0
 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);
 }