防止 WPF 窗口最小化(主要是 Winkey + D)
我有一个窗口,它应该像 Windows Vista(+) 小工具一样运行;它应该保留在桌面上,而不是出现在任务栏和 alt+tab 菜单上,但最重要的是,不要最小化。
这是它的标题:
由于其样式设置为 None,因此它没有控制按钮(最小化、关闭等),但仍然可以使用“显示桌面”功能和 Winkey+D 组合将其最小化。
我怎样才能防止这种情况发生?
谢谢!
I have a window which is supposed to act like a Windows Vista(+) gadget; its supposed to stay on the desktop, not to appear on taskbar and the alt+tab menu, but most importantly, not to get minimized.
Here is its header:
As its style is set to None, it has no control buttons (minimize, close, etc...) but it still can be minimized using the "Show Desktop" feature and the Winkey+D combination.
How can I prevent that from happening?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“显示桌面”不仅仅是最小化窗口 - 在最小化所有窗口后,它会将桌面窗口带到 z 顺序的顶部。 Raymond Chen对此有很好的解释。
您可以将窗口标记为“始终位于顶部”,但它会出现在每个窗口的顶部。我想不出任何其他方法可以阻止“显示桌面”隐藏您的窗口。对 Windows 边栏的快速实验表明,除非您设置“边栏始终位于其他窗口之上”,否则它也会在“显示桌面”上最小化。
"Show Desktop" does more than just minimize windows - after minimizing all the windows it can, it then brings the desktop window to the top of the z-order. Raymond Chen has a good explanation of this.
You could mark your window as "always on top" but then it would appear on top of every window. I can't think of any other way of preventing Show Desktop from hiding your window. A quick experiment with Windows Sidebar shows that it is also minimized on Show Desktop unless you set the "Sidebar is always on top of other windows".