为什么我显示自绘非模式对话框时会出现任务栏? .. 有时?

发布于 2024-12-03 02:41:34 字数 734 浏览 1 评论 0原文

我有一个有趣(但令人沮丧)的问题。我有一个使用全屏的应用程序(这是为了模拟第三方全屏 POS 应用程序)。

我的应用程序在全屏应用程序顶部显示一系列非模式对话框。它显示一个,隐藏它,然后显示下一个,隐藏它,依此类推。第三次显示后,Windows 任务栏大约 1 秒后出现。我不明白为什么。

我已经剥离了我的代码,看看它是否是我在 OnNcActivate 处理程序(我用它来绘制我的蒙皮窗口)中所做的事情,但我不认为这是因为问题似乎与时间相关。我自己尝试过运行 Spy++ 以及将消息转储到 m WindowProc 中,但我仍然看不到任何奇怪的东西可以给我任何线索。

我的日志中有一些 ID 为 0x36e 的消息,但我无法找出它们应该是什么。我检查了各种消息ID列表,但找不到它们。它们不应该是我自己的任何消息 ID,因为 WM_USER 直到 0x400 才开始。

我知道我可以通过自动隐藏任务栏来解决这个问题,但我不能要求我们的客户将他们的任务栏配置为自动隐藏来解决我的问题。

知道为什么任务栏会与我的非模式对话框相关吗?

编辑:我完全删除了我自己绘制的 GUI 代码,但仍然遇到同样的问题。我可能是错的,但似乎当我首先调用 ShowWindow( SW_HIDE) 时,Windows 会尝试激活“另一个窗口”(正如 MSDN 中所述)。我认为在这种情况下它会激活任务栏而不是 POS 应用程序。另一方面,如果我在第二个窗口上调用 ShowWindow( SW_HIDE ) 之前打开第二个窗口,那么它似乎会表现得很好。

干杯 火花

I have an interesting (but frustraring) problem. I have an application which uses the full screen (this is meant to simulate a third-party fullscreen POS application).

My application displays a sequence of modeless dialog boxes on top of the full screen application. It shows one, hides it, then shows the next, hides it etc. After the 3rd show, the Windows taskbar appears about 1 second later. I can't figure out why.

I've stripped my code right back to see if its something I'm doing in my OnNcActivate handler (which I use to draw my skinned window) but I don't think it is as the problem appears to be timing related. I've tried running Spy++ as well as dumping messages in m WindowProc myself and I still can't see anything odd that would give me any clues.

There are some messages with ID 0x36e in my logs but I can't find out what they are supposed to be. I've checked various message ID lists and can't find them. They shouldn't be any message IDs of my own since WM_USER doesn't start until 0x400.

I know I could get around this problem by auto-hiding the taskbar but I can't ask our customers to configure their taskbars to auto-hide to get round my problem.

Any ideas why the taskbar would appear in relation to my modeless dialog boxes?

EDIT: I completely stripped out my self-drawn GUI code and I still have the same problem. I could be wrong but it would seem that when I call ShowWindow( SW_HIDE) first, Windows tries to activate "another Window" (as it says in MSDN). I think in this case its activating the taskbar rather than the POS application. If on the other hand I open my second window before calling ShowWindow( SW_HIDE ) on the second, then it seems to behave itself.

Cheers
Sparky

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

左秋 2024-12-10 02:41:34

经过长时间的讨论,我得出的结论是 DestroyWindow 不是问题所在。我发现最后显示一个对话框..单击 POS,然后单击返回对话框,有时会出现任务栏。我花了整整一周的时间试图找出这一切的原因,但毫无结果。我认为将 POS 窗口指定为所有者可以解决问题 - 但事实并非如此。最后,我的问题的解决方案是在显示对话框之前确定任务栏是否完全被遮挡。如果是,我会在对话框显示期间隐藏任务栏(将其位置设置为 SW_HIDE),然后在关闭对话框时将其设置为 SW_SHOW。任务栏不会再弹出来烦人了。对于其他人的应用程序来说也许不是一个出色的解决方案,但对于我们的客户来说是完美的。

Following a long discussion I come to the conclusion that DestroyWindow was not the problem. I found in the end that displaying a dialog.. clicking on the POS, then clicking back on the dialog that sometimes the taskbar would appear. I have spent an entire week trying to find reasons for all of this but to no avail. I thought that assigning the POS window as the owner would solve the problem - it didn't. In the end the solution for my problem was to determine if the taskbar is obscured completely before showing my dialog. If it is, I hide the taskbar for the duration which my dialog is displayed (set its placement to SW_HIDE) and then set it to SW_SHOW when I close my dialog. The task bar doesn't pop up and annoy people anymore. Not a fantastic solution for other peoples' applications perhaps, but perfect for our customers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文