问题
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