Prevent WPF Window From Minimizing (Winkey + D, mostly)

谁说我不能喝 提交于 2019-12-24 00:34:33

问题


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!


回答1:


"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".



来源:https://stackoverflow.com/questions/1388453/prevent-wpf-window-from-minimizing-winkey-d-mostly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!