Process.arguments dans createprocess?

Ce qui suit fonctionne très bien dans la situation process.start.

private ssortingng Path() { RegistryKey Key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wizet\\"); RegistryKey Location = Key.OpenSubKey("MapleStory"); return Location.GetValue("ExecPath").ToSsortingng(); } public bool Launch() { maplestory = new ProcessStartInfo(); maplestory.FileName = Path() + @"\MapleStory.exe"; maplestory.Arguments = "WebStart"; MapleStory = Process.Start(maplestory); } 

Où placerais-je maintenant les ‘.Arguments’ si j’utilisais CreateProcess et où placerais-je CREATE_SUSPENDED également?

 CreateProcess(AppName, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, false, 0, IntPtr.Zero, null, ref si, out pi); 

Dans le deuxième argument, vous pouvez définir des options en ligne de commande. Et dans la sixième, vous pouvez définir des options de création telles que CREATE_SUSPENDED.

CreateProcess(AppName, "WebStart", IntPtr.Zero, IntPtr.Zero, false, CREATE_SUSPENDED, IntPtr.Zero, null, ref si, out pi);

Pour plus d’informations, voir http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

 public struct PROCESS_INFORMATION { public IntPtr hProcess; public IntPtr hThread; public uint dwProcessId; public uint dwThreadId; } public struct STARTUPINFO { public uint cb; public ssortingng lpReserved; public ssortingng lpDesktop; public ssortingng lpTitle; public uint dwX; public uint dwY; public uint dwXSize; public uint dwYSize; public uint dwXCountChars; public uint dwYCountChars; public uint dwFillAtsortingbute; public uint dwFlags; public short wShowWindow; public short cbReserved2; public IntPtr lpReserved2; public IntPtr hStdInput; public IntPtr hStdOutput; public IntPtr hStdError; } public struct SECURITY_ATTRIBUTES { public int length; public IntPtr lpSecurityDescriptor; public bool bInheritHandle; } using System; using System.Diagnostics; using System.Runtime.InteropServices; namespace CreateProcess { public static void Main() { PROCESS_INFORMATION pi = new PROCESS_INFORMATION(); STARTUPINFO si = new STARTUPINFO(); CreateProcess("MapleStory.exe", "WebStart", IntPtr.Zero, IntPtr.Zero, false, 0, IntPtr.Zero, null, ref si, out pi); } [DllImport("Kernel32.dll")] private static extern bool CreateProcess(ssortingng lpApplicationName, ssortingng lpCommandLine, IntPtr lpProcessAtsortingbutes, IntPtr lpThreadAtsortingbutes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, ssortingng lpCurrentDirectory, ref STARTUPINFO lpStartupInfo,out PROCESS_INFORMATION lpProcessInformation); } 
 CreateProcess(AppName, "WebStart", IntPtr.Zero, IntPtr.Zero, false, 0, IntPtr.Zero, null, ref si, out pi);