Shows how to launch process from forms.
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/button_images>
#include <xtd/forms/form>
#include <xtd/forms/vertical_layout_panel>
#include <xtd/diagnostics/process>
#include <xtd/invalid_operation_exception>
class main_form :
public form {
public:
main_form() {
text(
"Process form example");
controls().push_back(layout_panel);
client_size({350, 540});
layout_panel.controls().push_back_range({xtd_web_button, write_mail_button, open_home_folder_button, open_readme_txt_file_button, open_gammasoft_png_file_button, open_calculator_button});
xtd_web_button.text("Open xtd website...");
xtd_web_button.click += [] {
};
write_mail_button.text("Write mail...");
write_mail_button.click += [] {
process::start(
"mailto:gammasoft71@gmail.com?subject=Hi%20Gammasoft71&body=xtd%20is%20a%20great%20project.%0D%0A%20");
};
open_home_folder_button.text("Open home folder...");
open_home_folder_button.click += [] {
};
open_readme_txt_file_button.text("Open \"readme.txt\" file...");
open_readme_txt_file_button.click += [] {
};
open_gammasoft_png_file_button.text("Open \"gammasoft.png\" file...");
open_gammasoft_png_file_button.click += [] {
};
open_calculator_button.text("Launch Calculator...");
open_calculator_button.click += [] {
};
}
private:
button open_home_folder_button;
button open_readme_txt_file_button;
button open_gammasoft_png_file_button;
button open_calculator_button;
};
auto main() -> int {
}
Specifies a set of values that are used when you start a process.
Definition process_start_info.hpp:39
const xtd::string & working_directory() const noexcept
When the xtd::diagnostics::process_start_info::use_shell_execute property is false,...
bool use_shell_execute() const noexcept
Gets a value indicating whether to use the operating system shell to start the process.
bool start()
Starts (or reuses) the process resource that is specified by the xtd::diagnostics::process::start_inf...
@ home
The file system directory that contains home folder.
Definition environment.hpp:243
static xtd::string get_folder_path(environment::special_folder folder)
Gets the path to the system special folder that is identified by the specified enumeration.
Definition environment.hpp:613
static xtd::operating_system os_version() noexcept
Gets an xtd::operating_system object that contains the current platform identifier and version number...
The exception that is thrown when the format of an argument does not meet the parameter specification...
Definition invalid_operation_exception.hpp:19
static void write_all_text(const xtd::string &path, type_t text)
Writes text to a file, and then closes the file. If the specified file does not exist,...
Definition file.hpp:359
static xtd::string get_temp_path() noexcept
Returns the path of the current user's temporary folder.
static xtd::string combine(const xtd::string &path1, const xtd::string &path2)
Combines two path strings.
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.hpp:17
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31