任务栏图标消失,丢失或未显示 [英] Task bar icon dissapeared, missing or not shown

查看:133
本文介绍了任务栏图标消失,丢失或未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试解决基于对话框的应用程序的问题:

有人决定在初始化主对话框时显示带有旋转沙漏的对话框:

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>
}



问题在于,当此沙漏对话框关闭时,它似乎会带走任务栏图标. 任务栏图标消失,被隐藏或其他任何内容,用户必须 alt-tab 将其置于最前面(还要弄清楚那里的窗口,并且不要启动该应用及以上).

我已经做了一些小小的改动就解决了这个问题:



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!

推荐答案

出于测试目的,您是否尝试过在Init Dialog(初始化对话框)上进行初始化,例如在按钮上按或计时器刻度.我怀疑问题出在onInitDialog中.

如果它适用于,您可以考虑在OnInitDialog中禁用该对话框,然后对单独的自定义消息进行初始化,该消息可以从oninitdialog中发布,然后在完成初始化后重新启用该对话框
Have you tried, for testing purposes, doing the initialisation after on Init Dialog, e.g. on a button press or a timer tick. I suspect the problem is to do with it being in onInitDialog.

If it works in thuis scienario , you could consider disabling the dialog in OnInitDialog, then doing your initialisation on a separate custom message which you can post from oninitdialog, then when your intialisation is done reenable the dialog


这篇关于任务栏图标消失,丢失或未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆