Hi people,
I'm trying to fix a problem with a dialog based app:
Somebody decided to show a dialog with a turning hourglass while the main dialog is initializing:
BOOL CMainDlg::OnInitDialog() {
CDialog::OnInitDialog();
<Launch thread to open hourglass dialog and control animation>
<Do all initialization stuff>
<Abruptly kill the thread with no remorse>
}
The problem is that when this hourglass
dialog gets closed it seems to
take away the taskbar icon with it. The
taskbar icon dissapears, gets hidden or whatever and the user has to
alt-tab to bring it to front (plus figuring out the window is there and not launching the app over and over).
I've managed to solve this to some point with that little change:
BOOL CMainDlg::OnInitDialog() {
CDialog::OnInitDialog();
<Launch thread to open hourglass dialog and control animation>
<Do all initialization stuff>
}
...
void CMainDlg::OnShowWindow(BOOL bShow, UINT nStatus) {
<Kindly ask the thread to stop>
}
But I still have the same problem if the user brings
another window to front while the hourglass dialog is running. The taskbar icon gets lost again.
I've tried to bring the main dialog to front when it's done (with no luck). I've also tried to open de hourglass dialog somewhere else. And a bazillion useless workarounds.
Anybody faced this problem and can put me in the path?
Thanks in advance!