Splashscreen in pure winapi

Nick Shaforostoff shaforostoff at kde.ru
Sun May 18 17:57:54 CEST 2008


It is obvious that the biggest part in app startup time is loading of libs
(particularly Qt).

I've got splashscreen written on pure winapi, which compiles into 8 kb exe.
It can load external or embedded (windows resources) image and close when
the app is loaded.

app's main() needs to be slightly updated:

      MainWindow mainWin(&translator);
      mainWin.show();
	if (argc==2)
	{
		QString hwnd=QString::fromLatin1(argv[1]);
		SendNotifyMessage((HWND)hwnd.toLong(),WM_FINISHSPLASH,0,0);
	}
      return app.exec();

Attached is the draft code. It compiles with MSVS2005 and loads first
embedded bitmap
(use XN Resource Editor to embed it and upx to compress it).
Linker->Input->Additional Dependencies=kernel32.lib gdi32.lib user32.lib
shell32.lib $(NOINHERIT)
Linker->System->SubSystem=Windows (/SUBSYSTEM:WINDOWS)

license: public domain.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: splash.7z
Type: application/octet-stream
Size: 2247 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-windows/attachments/20080518/b77546f6/attachment.obj 


More information about the Kde-windows mailing list