xtd - Reference Guide
0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
|
#include <application.h>
Provides static methods and properties to manage an application, such as methods to start and stop an application, to process Windows messages, and methods to get information about an application. This class cannot be inherited.
Inherits xtd::static_object.
Static Public Attributes | |
static event< application, delegate< void(const event_args &)> > | application_exit |
Occurs when the application is about to shut down. | |
static event< application, delegate< void(const event_args &)> > | enter_thread_modal |
Occurs when the application is about to enter a modal state. | |
static event< application, delegate< void(const event_args &)> > | idle |
Occurs when the application finishes processing and is about to enter the idle state. | |
static event< application, delegate< void(const event_args &)> > | leave_thread_modal |
Occurs when the application is about to leave a modal state. | |
static event< application, delegate< void(const event_args &)> > | thread_exit |
Occurs when a thread is about to shut down. When the main thread for an application is about to be shut down, this event is raised first, followed by an application_exit event. | |
Static Public Member Functions | |
static void | add_message_filter (const imessage_filter &value) |
Adds a message filter to monitor Windows messages as they are routed to their destinations. | |
static bool | allow_quit () |
Gets a value indicating whether the caller can quit this application. | |
static xtd::ustring | common_app_data_path () |
Gets the path for the application data that is shared among all users. | |
static xtd::ustring | company_name () |
Gets the company name associated with the application. | |
static bool | dark_mode_enabled () |
Return true if dark mode is enabled for the application; otherwise return false. | |
static void | do_events () |
Processes all Windows messages currently in the message queue. | |
static void | enable_button_images () |
Enables button images for the application. | |
static void | enable_dark_mode () |
Enables dark mode for the application. | |
static void | enable_light_mode () |
Enables light mode for the application. | |
static void | enable_menu_images () |
Enables menu images for the application. | |
static void | enable_visual_styles () |
Enables visual styles for the application. | |
static xtd::ustring | executable_name () |
Gets the executable name for the executable file that started the application, including the executable extension. | |
static xtd::ustring | executable_path () |
Gets the path for the executable file that started the application, including the executable name. | |
static void | exit () |
Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed. | |
static void | exit (cancel_event_args &e) |
Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed. | |
static void | exit_thread () |
Exits the message loop on the current thread and closes all windows on the thread. | |
static bool | light_mode_enabled () |
Return true if dark mode is enabled for the application; otherwise return false. | |
static bool | message_loop () |
Gets a value indicating whether a message loop exists on this thread. | |
static const form_collection | open_forms () |
Gets a collection of open forms owned by the application. | |
static xtd::ustring | product_name () |
Gets the product name associated with this application. | |
static xtd::ustring | product_version () |
Gets the product version associated with this application. | |
static void | raise_idle (const event_args &e) |
Raises the Idle event. | |
static void | register_message_loop_callback (message_loop_callback callback) |
Registers a callback for checking whether the message loop is running in hosted environments. | |
static void | remove_message_filter (const imessage_filter &value) |
Removes a message filter from the message pump of the application. | |
static void | restart () |
Shuts down the application and starts a new instance immediately. | |
static void | run () |
Begins running a standard application message loop on the current thread, without a form. | |
static void | run (application_context &context) |
Begins running a standard application message loop on the current thread, with an application_context. | |
static void | run (const form &main_form) |
Begins running a standard application message loop on the current thread, and makes the specified form visible. | |
static xtd::ustring | startup_path () |
Gets the path for the executable file that started the application, not including the executable name. | |
static const xtd::forms::theme & | theme () |
static void | theme (const xtd::forms::theme &theme) |
static void | theme (const xtd::ustring &theme_name) |
static const std::vector< xtd::ustring > & | theme_names () |
static bool | use_visual_styles () |
Gets a value that indicates whether visual styles are enabled for the application. | |
static bool | use_wait_cursor () |
Gets whether the wait cursor is used for all open forms of the application. | |
static void | use_wait_cursor (bool use_wait_cursor) |
Sets whether the wait cursor is used for all open forms of the application. | |
static xtd::ustring | user_app_data_path () |
Gets the path for the application data of a user. | |
|
static |
Adds a message filter to monitor Windows messages as they are routed to their destinations.
The | implementation of the imessage_filter interface you want to install. |
|
static |
Gets a value indicating whether the caller can quit this application.
|
static |
Gets the path for the application data that is shared among all users.
|
static |
Gets the company name associated with the application.
|
static |
Return true if dark mode is enabled for the application; otherwise return false.
|
static |
Processes all Windows messages currently in the message queue.
|
static |
Enables button images for the application.
|
static |
Enables dark mode for the application.
|
static |
Enables light mode for the application.
|
static |
Enables menu images for the application.
|
static |
Enables visual styles for the application.
|
static |
Gets the executable name for the executable file that started the application, including the executable extension.
|
static |
Gets the path for the executable file that started the application, including the executable name.
|
static |
Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed.
|
static |
Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed.
e | Returns whether any Form within the application cancelled the exit. |
|
static |
Exits the message loop on the current thread and closes all windows on the thread.
|
static |
Return true if dark mode is enabled for the application; otherwise return false.
|
static |
Gets a value indicating whether a message loop exists on this thread.
|
static |
Gets a collection of open forms owned by the application.
|
static |
Gets the product name associated with this application.
|
static |
Gets the product version associated with this application.
|
static |
Raises the Idle event.
e | The event_args objects to pass to the idle event. |
|
static |
Registers a callback for checking whether the message loop is running in hosted environments.
callback | The method to call when Windows Forms needs to check if the hosting environment is still sending messages. |
|
static |
Removes a message filter from the message pump of the application.
value | The implementation of the imessage_filter to remove from the application. |
|
static |
Shuts down the application and starts a new instance immediately.
|
static |
Begins running a standard application message loop on the current thread, without a form.
|
static |
Begins running a standard application message loop on the current thread, with an application_context.
context | An ApplicationContext in which the application is run. |
|
static |
Begins running a standard application message loop on the current thread, and makes the specified form visible.
main_form | A form that represents the form to make visible. |
|
static |
Gets the path for the executable file that started the application, not including the executable name.
|
static |
Gets a value that indicates whether visual styles are enabled for the application.
|
static |
Gets whether the wait cursor is used for all open forms of the application.
|
static |
Sets whether the wait cursor is used for all open forms of the application.
use_wait_cursor | true is the wait cursor is used for all open forms; otherwise, false. |
|
static |
Gets the path for the application data of a user.