-
I am currently trying to display a splash window using WinUI3 in C++. In the App.xaml.cpp, I implemented the splash window as shown below, but it appears completely white until the main window is displayed. How can I display the contents of the splash window before the main window shows up? SampleApp::SplashScreen is a Window. void App::OnLaunched([[maybe_unused]] LaunchActivatedEventArgs const& e)
{
SapmleApp::SplashScreen splash_screen;
splash_screen.Activate();
// Sleep 5 seconds
std::this_thread::sleep_for(std::chrono::seconds(5));
window = make<MainWindow>();
window.Activate();
splash_screen.Close();
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Probably because you are blocking the main thread with the "sleep for 5 seconds". Try creating a |
Beta Was this translation helpful? Give feedback.
Probably because you are blocking the main thread with the "sleep for 5 seconds". Try creating a
DispatcherQueueTimer
with 5 seconds and then asynchronously show the main window once it elapses.