当第 3 方全屏应用程序顶部显示非模式对话框时,为什么会出现任务栏?
我已在以下位置上传了 VS2010 项目。一旦全屏应用程序运行,就应该运行此测试应用程序。一旦运行,您就有 2 秒钟的时间返回全屏应用程序。它使用全屏应用程序(应该是最后一个获得焦点的窗口)作为对话框的所有者来创建 2 个无模式对话框。循环显示一个对话框,隐藏,显示第二个对话框,隐藏,然后再次显示第一个对话框。我发现当第二次显示第一个对话框时,会弹出任务栏。我花了 4 天痛苦的时间试图了解这里发生的事情,我迫切需要一些帮助。
我收到了一些帮助,建议当我调用 DestroyWindow 来隐藏对话框时,Windows 会将焦点放在“某处” - 在我的例子中是任务栏。以前,当我问这个问题时,我没有使用全屏应用程序作为窗口的所有者。我本以为焦点应该回到所有者窗口?在我的对话框上调用 DestroyWindow 之前,我还尝试在全屏应用程序上调用 SetFocus() 和 SetForegroundWindow() - 但这似乎会导致任务栏每次都出现,而我根本不希望出现这种情况。
请帮忙!
I've uploaded a VS2010 project at the below location. This test app should be run once you have a full screen application running. As soon as its running, you have 2 seconds to click back on your fullscreen application. It creates 2 modeless dialog boxes using the full screen application (which should be the last window to have focus) as the owner of the dialog boxes. One dialog is displayed, hidden, the second dialog is displayed, hidden and then the first dialog is displayed again in a cycle. What I find is that when the first dialog box is displayed for the second time, the taskbar pops up. I've spent 4 painful days trying to understand whats going on here and I am desperate for some help.
I received some help which suggested that when I call DestroyWindow to hide the dialogs, Windows would put focus "somewhere" - and in my case the taskbar. Previously when I asked this question I wasn't using the full screen application as the Owner of my windows. I would have thought that the focus should go back to the owner window? I have also tried calling SetFocus() and SetForegroundWindow() on the full screen application prior to calling DestroyWindow on my dialog - but the seems to cause the taskbar to appear everytime and I don't want that at all.
Please help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论