Skip to content

ui::Launcher

Header: winui/ui/Launcher.hpp.

What opens URIs and files with the apps the OS has registered for them. ui::launch_uri() and ui::launch_file() go through it, and so do a hyperlink Button's and a Hyperlink inline's navigate_uri.

There is one for the whole process: the platform's, or a double a test installs with ui::testing::set_launcher(). App code calls the free functions and never needs the class. It is public so a test double can derive from it.

~Launcher

virtual ~Launcher() = default

launch_uri

virtual void launch_uri(const std::string& uri) = 0

Opens uri, fire and forget, with its default handler (a browser for http/https, the mail client for mailto, ...). A URI nothing handles is dropped.

launch_file

virtual void launch_file(const std::filesystem::path& file) = 0

Opens file, fire and forget, with the app registered for its type. A file that does not exist is dropped.