“桌面"窗口 [英] Window "on desktop"
本文介绍了“桌面"窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在使用 Rainlendar 一段时间,我注意到它有一个选项来放置窗口在桌面上".它就像一个最底部的窗口(相对于最顶部).
I've been using Rainlendar for some time and I noticed that it has an option to put the window "on desktop". It's like a bottomMost window (as against topmost).
如何在 WPF 应用程序上执行此操作?
How could I do this on a WPF app?
谢谢
推荐答案
我的回答是针对 Win32 API,而不是特定于 WPF(并且可能需要来自 C# 的 P/Invoke):
My answer is in terms of the Win32 API, not specific to WPF (and probably requiring P/Invoke from C#):
Rainlendar 有两个选项:
Rainlendar has two options:
- 在桌面上",它成为资源管理器桌面窗口(程序管理器")的子级.您可以使用 SetParent API 来实现这一点.
- 在底部"就是您所描述的 - 它的窗口位于 Z 顺序的底部,就在桌面的前面.将它们放在那里很容易开始(请参阅 SetWindowPos) - 诀窍是在点击时阻止它们出现在前面.我建议处理 WM_WINDOWPOSCHANGING 消息.莉>
- "On Desktop", it becomes a child of the Explorer desktop window ("Program Manager"). You could achieve this with the SetParent API.
- "On Bottom" is what you describe - its windows stay at the bottom of the Z-order, just in front of the desktop. It's easy enough to put them there to begin with (see SetWindowPos) - the trick is to stop them coming to the front when clicked. I would suggest handling the WM_WINDOWPOSCHANGING message.
这篇关于“桌面"窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文