Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From the process creation flags documentation, I grab the values for each flag I'm trying to pass. Then, I pass the flags using like so:
- const uint CREATE_SUSPENDED = 0x00000004;
- const uint CREATE_NEW_CONSOLE = 0x00000010;
- [DllImport("kernel32.dll", SetLastError = true)]
- private static extern Boolean CreateProcess(String lpApplicationName, String lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes,
- Boolean bInheritHandles, UInt32 dwCreationFlags, IntPtr lpEnvironment, String lpCurrentDirectory, Byte[] lpStartupInfo,
- out PROCESS_INFORMATION lpProcessInfo);
- public static MyCreateProcess(path, QuotedPath) {
- CreateProcess(path, QuotedPath, IntPtr.Zero, IntPtr.Zero, false, CREATE_SUSPENDED | CREATE_NEW_CONSOLE , IntPtr.Zero, null, ref SI, ref PI);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement