xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
process_start_info.h
Go to the documentation of this file.
1 #pragma once
5 #include <filesystem>
6 #include <map>
7 #include <memory>
8 #include <string>
9 #include <vector>
10 #include "../core_export.h"
11 #include "../object.h"
12 #include "../security/secure_string.h"
13 #include "process_window_style.h"
14 
16 namespace xtd {
18  namespace diagnostics {
31  class core_export_ process_start_info final : public object {
32  public:
36  process_start_info() = default;
37 
42  explicit process_start_info(const xtd::ustring& file_name);
43 
49  process_start_info(const xtd::ustring& file_name, const xtd::ustring& arguments);
50 
53  process_start_info& operator=(const process_start_info&) = default;
55 
58  const xtd::ustring& arguments() const;
63 
67  bool create_no_window() const;
73 
76  const xtd::ustring& domain() const;
81 
86  const std::map<xtd::ustring, xtd::ustring>& environment() const;
91  std::map<xtd::ustring, xtd::ustring>& environment();
92 
96  const std::map<xtd::ustring, xtd::ustring>& environment_variables() const;
100  std::map<xtd::ustring, xtd::ustring>& environment_variables();
101 
105  bool error_dialog() const;
111 
115  intptr_t error_dialog_parent_handle() const;
121 
126  const xtd::ustring& file_name() const;
138  process_start_info& file_name(const std::filesystem::path& value);
140  process_start_info& file_name(const char* value);
142 
147  bool load_user_profile() const;
154 
172 
180 
398 
526 
774 
780  const xtd::ustring& user_name() const;
788 
797  bool use_shell_execute() const;
808 
820 
825  std::vector<xtd::ustring> verbs() const;
826 
836 
856 
857  private:
858  xtd::ustring file_name_;
859  xtd::ustring arguments_;
860  bool create_no_window_ = false;
861  xtd::ustring domain_;
862  bool error_dialog_ = false;
863  intptr_t error_dialog_parent_handle_ = 0;
864  std::map<xtd::ustring, xtd::ustring> environment_variables_;
865  bool load_user_profile_ = false;
867  bool redirect_standard_error_ = false;
868  bool redirect_standard_input_ = false;
869  bool redirect_standard_output_ = false;
870  xtd::ustring user_name_;
871  bool use_shell_execute_ = true;
872  xtd::ustring verb_;
874  xtd::ustring working_directory_;
875  };
876  }
877 }
Specifies a set of values that are used when you start a process.
Definition: process_start_info.h:31
const xtd::ustring & user_name() const
Gets the user name to be used when starting the process.
intptr_t error_dialog_parent_handle() const
Gets the window handle to use when an error dialog box is shown for a process that cannot be started.
process_start_info & working_directory(const xtd::ustring &value)
When the xtd::diagnostics::process_start_info::use_shell_execute property is false,...
process_start_info & password(const xtd::security::secure_string &value)
Sets a secure string that contains the user password to use when starting the process.
bool load_user_profile() const
Gets a value that indicates whether the Windows user profile is to be loaded from the registry.
const xtd::ustring & working_directory() const
When the xtd::diagnostics::process_start_info::use_shell_execute property is false,...
process_start_info & file_name(const xtd::ustring &value)
Sets the application or document to start.
process_start_info & domain(const xtd::ustring &value)
Sets a value that identifies the domain to use when starting the process.
const xtd::security::secure_string & password() const
Gets a secure string that contains the user password to use when starting the process.
process_start_info & file_name(const std::filesystem::path &value)
Sets the application or document to start.
std::map< xtd::ustring, xtd::ustring > & environment_variables()
Gets search paths for files, directories for temporary files, application-specific options,...
const xtd::ustring & file_name() const
Gets the application or document to start.
process_start_info & window_style(xtd::diagnostics::process_window_style value)
Sets the window state to use when the process is started.
process_start_info & load_user_profile(bool value)
Sets a value that indicates whether the Windows user profile is to be loaded from the registry.
process_start_info(const xtd::ustring &file_name, const xtd::ustring &arguments)
Initializes a new instance of the xtd::diagnostics::process_start_info class, specifies an applicatio...
process_start_info & redirect_standard_error(bool value)
Sets a value that indicates whether the error output of an application is written to the xtd::diagnos...
const std::map< xtd::ustring, xtd::ustring > & environment() const
Gets the environment variables that apply to this process and its child processes.
process_start_info & verb(const xtd::ustring &value)
Sts the verb to use when opening the application or document specified by the FileName property.
process_start_info & user_name(const xtd::ustring &value)
Sets the user name to be used when starting the process.
process_start_info & arguments(const xtd::ustring &value)
Sets the set of command-line arguments to use when starting the application.
bool redirect_standard_input() const
Gets a value indicating whether the input for an application is read from the Process....
process_start_info & use_shell_execute(bool value)
Sets a value indicating whether to use the operating system shell to start the process.
const std::map< xtd::ustring, xtd::ustring > & environment_variables() const
Gets search paths for files, directories for temporary files, application-specific options,...
process_start_info & create_no_window(bool value)
Sets a value indicating whether to start the process in a new window.
std::vector< xtd::ustring > verbs() const
Gets the set of verbs associated with the type of file specified by the xtd::diagnostics::process_sta...
std::map< xtd::ustring, xtd::ustring > & environment()
Gets the environment variables that apply to this process and its child processes.
process_start_info & redirect_standard_output(bool value)
Sets a value that indicates whether the textual output of an application is written to the xtd::diagn...
process_start_info & error_dialog_parent_handle(intptr_t value)
Sets the window handle to use when an error dialog box is shown for a process that cannot be started.
const xtd::ustring & domain() const
Gets a value that identifies the domain to use when starting the process.
xtd::ustring password_in_clear_text() const
Gets the user password in clear text to use when starting the process.
xtd::diagnostics::process_window_style window_style() const
Gets the window state to use when the process is started.
bool redirect_standard_error() const
Gets a value that indicates whether the error output of an application is written to the xtd::diagnos...
bool redirect_standard_output() const
Gets a value that indicates whether the textual output of an application is written to the xtd::diagn...
const xtd::ustring & arguments() const
Gets the set of command-line arguments to use when starting the application.
bool error_dialog() const
Gets a value indicating whether an error dialog box is displayed to the user if the process cannot be...
process_start_info & password_in_clear_text(const xtd::ustring &value)
Sets the user password in clear text to use when starting the process.
process_start_info & redirect_standard_input(bool value)
Sts a value indicating whether the input for an application is read from the Process....
process_start_info(const xtd::ustring &file_name)
Initializes a new instance of the xtd::diagnostics::process_start_info class and specifies a file nam...
bool use_shell_execute() const
Gets a value indicating whether to use the operating system shell to start the process.
xtd::ustring verb() const
Gets the verb to use when opening the application or document specified by the FileName property.
process_start_info()=default
Initializes a new instance of the xtd::diagnostics::process_start_info class without specifying a fil...
bool create_no_window() const
Gets a value indicating whether to start the process in a new window.
process_start_info & error_dialog(bool value)
Sets a value indicating whether an error dialog box is displayed to the user if the process cannot be...
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition: object.h:26
Represents text that should be kept confidential, such as by deleting it from computer memory when no...
Definition: secure_string.h:18
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
#define core_export_
Define shared library export.
Definition: core_export.h:13
process_window_style
Specified how a new window should appear when the system starts a process.
Definition: process_window_style.h:17
@ normal
The normal, visible window style. The system displays a window with Normal style on the screen,...
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::diagnostics::process_window_style enum class.