Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quickest way to implement a C++ Win32 Splash Screen

Tags:

c++

winapi

What's a simple way to implement a c++ Win32 program to...
- display an 800x600x24 uncompressed bitmap image
- in a window without borders (the only thing visible is the image)
- that closes after ten seconds
- and doesn't use MFC

like image 845
BeachRunnerFred Avatar asked Feb 04 '23 13:02

BeachRunnerFred


1 Answers

If you're targeting modern versions of Windows (Windows 2000) and above, you can use the UpdateLayeredWindow function to display any bitmap (including one with an alpha channel, if so desired).

I blogged a four-part series on how to write a C++ Win32 app that does this. If you need to wait for exactly ten seconds to close the splash screen (instead of until the main window is ready), you would need to use Dan Cristoloveanu's suggested technique of a timer that calls DestroyWindow.

like image 200
Bradley Grainger Avatar answered Feb 06 '23 03:02

Bradley Grainger