Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }