当任务栏/开始菜单位于最上面的窗体/窗口上方时,窗口消息发送到它吗?

发布于 2024-12-28 08:40:36 字数 259 浏览 5 评论 0原文

我在 Windows 7 中有一个 C# Windows 窗体程序,但我认为它适用于任何 Windows 程序。

我的程序的主窗体覆盖了整个屏幕,并且设置了 Topmost 属性。但是,例如,当我单击“开始”键打开“开始”菜单时,任务栏和“开始”菜单将显示在“始终在最前面”窗体的顶部。

当发生这种情况并且我的窗体/窗口不再是最上面的窗口(或在 Z 顺序的顶部)时,是否有窗口消息 (WM_) 发送到我的窗体/窗口?我想使用 WndProc 捕获它。

谢谢

I have a C# Windows Forms program, in Windows 7, but I think it applies to any Windows program.

The main form of my program covers the entire screen, and has the Topmost property set. However, when I click the Start key to open the Start menu for example, the taskbar and Start Menu are displayed, on top of my Always on Top form.

Is there a window message (WM_) that is sent to my form/window when this happens and my form/window is no longer the topmost window (or on top of the Z-order)? I'd like to catch it using WndProc.

Thank you

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

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

发布评论

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

评论(2

祁梦 2025-01-04 08:40:36

我认为阅读 Raymond Chen 的博客文章< /a> 虽然这感觉只是一个有趣的故事,但请非常非常认真地对待它。

引用:“当两个程序像这样‘一决高下’时,你无法预测哪一个会赢,但你可以 100% 确定地预测谁会输:用户。”

I think it is wise to consume Raymond Chen his blog post and although it feels like just a fun story, take it very, very serious.

Quote: "When two programs "duke it out" like this, you can't predict which one will win, but you can predict with 100% certainty who will lose: The user. "

Hello爱情风 2025-01-04 08:40:36

正如rene在上面的帖子中所说,如果超过1个应用程序要使用相同的逻辑,这将是一个竞争条件,但如果你仍然想这样做,我想看看Form.Deactivated 将是一个好的开始。

As rene said in above post, it is going to be a race condition if more than 1 applications are going to use the same logic, but if you still want to do it, I think having a look at Form.Deactivated will be a good start.

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