public ConsoleProcess(string consoleScript, string startupDirectory, bool visibleOnStartup = true) { ConsoleScript = consoleScript; StartupDirectory = startupDirectory; VisibleOnStartup = visibleOnStartup; // Set process type ProcessType = ProcessType.Console; _processClosedCallback = (IntPtr process) => { ProcessClosedCallback?.Invoke(this); }; _processInitialziedCallback = (IntPtr process) => { ProcessInitializedCallback?.Invoke(this); }; CreateProcessObject(null, null, consoleScript, startupDirectory, true, visibleOnStartup, _processClosedCallback, _processInitialziedCallback, ref _processPointer); }
public GUIProcess(string processPath, string processArgs = "", bool visibleOnStartup = true) { ProcessPath = processPath; ProcessArgs = processArgs; VisibleOnStartup = visibleOnStartup; // Set process type ProcessType = ProcessType.GUI; _processClosedCallback = (IntPtr process) => { ProcessClosedCallback?.Invoke(this); }; _processInitialziedCallback = (IntPtr process) => { ProcessInitializedCallback?.Invoke(this); }; CreateProcessObject(processPath, processArgs, null, null, false, visibleOnStartup, _processClosedCallback, _processInitialziedCallback, ref _processPointer); }