[Qt-interest] [SOLVED] How to get Windows taskbar button to appear during splash screen
Tony Rietwyk
tony.rietwyk at rightsoft.com.au
Fri May 21 07:21:49 CEST 2010
Hi Everybody,
Back in Feb I raised this issue regarding QSplashScreen not having a task
button to enable the user to activate the application after switching away
from its installer.
I finally had time to look into it and switching off WS_EX_TOOLWINDOW seems
to work:
#if defined (Q_OS_WIN)
#include <windows.h>
#include <winuser.h>
#endif
...
splash = new QSplashScreen( pixmap );
#if defined (Q_OS_WIN)
int exstyle = GetWindowLong( splash->winId(), GWL_EXSTYLE );
SetWindowLong( splash->winId(), GWL_EXSTYLE, exstyle & ~WS_EX_TOOLWINDOW
);
#endif
splash->show();
splash->activateWindow();
splash->raise();
qApp->processEvents();
// Continue start up processing....
Tony.
On Thu, Feb 18, 2010 at 12:33 PM, Tony Rietwyk
<tony.rietwyk at rightsoft.com.au> wrote:
Hi Everybody,
Using Qt 4.6.0 and VS 2008 (no service pack). My application startup
sequence was roughly:
QApplication a( argc, argv );
show_splash_screen();
if (first_time_run_since_installed)
show_config_wizard(); // Uses splash as parent
// Load data from database
remove_splash_screen();
MyMainWindow w;
w.show();
a.exec();
Users on various versions of Windows complain that immediately after
installion, the config wizard would not appear in front of other running
applications, but behind them. Furthermore, the application button does not
appear in the task bar until the main window is visible. If the user cannot
see the config dialog, they don't realise the application is running. This
gives a poor first impression of the application!
I have moved all of the initialisation into slots triggered by
QTimer::singleShot in the main window constructor, so now my main looks
like:
QApplication a( argc, argv );
MyMainWindow w;
a.exec();
But both problems still remain. The Win32 documentation says that the
taskbar button is created "whenever the application creates an unowned
primary window" - whatever that means in Qt terms!
How can I force the taskbar button to appear as soon as the application is
running on Windows?
How can I force the config wizard to appear on top of other applications
before the main window?
On Mac OSX 10.5, the application icon appears in the dock even before the
splash screen appears.
Thanks for any suggestions,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100521/363c5982/attachment.html
More information about the Qt-interest-old
mailing list