#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.
Events | |
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. | |
Properties | |
static bool | allow_quit () noexcept |
Gets a value indicating whether the caller can quit this application. | |
static xtd::ustring | common_app_data_path () noexcept |
Gets the path for the application data that is shared among all users. | |
static xtd::ustring | company_name () noexcept |
Gets the company name associated with the application. | |
static bool | dark_mode_enabled () noexcept |
Return true if dark mode is enabled for the application; otherwise return false. | |
static bool | light_mode_enabled () noexcept |
Return true if dark mode is enabled for the application; otherwise return false. | |
static xtd::ustring | executable_name () noexcept |
Gets the executable name for the executable file that started the application, including the executable extension. | |
static xtd::ustring | executable_path () noexcept |
Gets the path for the executable file that started the application, including the executable name. | |
static bool | message_loop () noexcept |
Gets a value indicating whether a message loop exists on this thread. | |
static const form_collection | open_forms () noexcept |
Gets a collection of open forms owned by the application. | |
static xtd::ustring | product_name () noexcept |
Gets the product name associated with this application. | |
static xtd::ustring | product_version () noexcept |
Gets the product version associated with this application. | |
static xtd::ustring | startup_path () noexcept |
Gets the path for the executable file that started the application, not including the executable name. | |
static const xtd::forms::style_sheets::style_sheet & | style_sheet () noexcept |
Gets current xtd::forms::style_sheets::style_sheet style sheet. | |
static void | style_sheet (const xtd::forms::style_sheets::style_sheet &value) |
Sets current xtd::forms::style_sheets::style_sheet style sheet. | |
static const xtd::forms::style_sheets::style_sheet::style_sheets_t & | style_sheets () noexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheets. | |
static const xtd::forms::style_sheets::style_sheet::style_sheet_names_t & | style_sheet_names () noexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheet names. | |
static const xtd::forms::style_sheets::style_sheet & | system_style_sheet () noexcept |
Gets system xtd::forms::style_sheets::style_sheet style sheet. | |
static xtd::ustring | user_app_data_path () noexcept |
Gets the path for the application data of a user. | |
static bool | use_system_controls () noexcept |
Gets a value that indicates whether system controls are enabled for the application. | |
static bool | use_visual_styles () noexcept |
Gets a value that indicates whether visual styles are enabled for the application. | |
static bool | use_wait_cursor () noexcept |
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. | |
Methods | |
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 void | disable_font_size_correction () |
Disables font size correction for the application. | |
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_system_controls () |
Enables system control for the application. | |
static void | enable_system_font_size () |
Enables system font size for the application. | |
static void | enable_visual_styles () |
Enables visual styles for the application. | |
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 xtd::forms::style_sheets::style_sheet | get_style_sheet_from_name (const xtd::ustring &name) |
Gets the installed xtd::forms::style_sheets::style_sheet style sheet from specified name. | |
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 |
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. |
|
staticnoexcept |
Gets a value indicating whether the caller can quit this application.
|
staticnoexcept |
Gets the path for the application data that is shared among all users.
|
staticnoexcept |
Gets the company name associated with the application.
|
staticnoexcept |
Return true if dark mode is enabled for the application; otherwise return false.
|
static |
Disables font size correction for the application.
|
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 system control for the application.
|
static |
Enables system font size for the application.
|
static |
Enables visual styles for the application.
|
staticnoexcept |
Gets the executable name for the executable file that started the application, including the executable extension.
|
staticnoexcept |
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 |
Gets the installed xtd::forms::style_sheets::style_sheet style sheet from specified name.
xtd::argument_exception | The style sheet name not tvalid. |
|
staticnoexcept |
Return true if dark mode is enabled for the application; otherwise return false.
|
staticnoexcept |
Gets a value indicating whether a message loop exists on this thread.
|
staticnoexcept |
Gets a collection of open forms owned by the application.
|
staticnoexcept |
Gets the product name associated with this application.
|
staticnoexcept |
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. |
|
staticnoexcept |
Gets the path for the executable file that started the application, not including the executable name.
|
staticnoexcept |
Gets current xtd::forms::style_sheets::style_sheet style sheet.
|
static |
Sets current xtd::forms::style_sheets::style_sheet style sheet.
value | The current xtd::forms::style_sheets::style_sheet style sheet. |
|
staticnoexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheet names.
|
staticnoexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheets.
|
staticnoexcept |
Gets system xtd::forms::style_sheets::style_sheet style sheet.
|
staticnoexcept |
Gets a value that indicates whether system controls are enabled for the application.
|
staticnoexcept |
Gets a value that indicates whether visual styles are enabled for the application.
|
staticnoexcept |
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. |
|
staticnoexcept |
Gets the path for the application data of a user.
|
static |
Occurs when the application is about to shut down.
|
static |
Occurs when the application is about to enter a modal state.
|
static |
Occurs when the application finishes processing and is about to enter the idle state.
|
static |
Occurs when the application is about to leave a modal state.
|
static |
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.