当任务栏/开始菜单位于最上面的窗体/窗口上方时,窗口消息发送到它吗?
我在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为阅读 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. "
正如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.