如何使“始终位于bottom'窗口 [英] How to make 'always-on-bottom'-window

查看:314
本文介绍了如何使“始终位于bottom'窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道如何使一个始终位于bottom'窗口,或固定在桌面上的窗口?它应该接收焦点和鼠标点击,而应留在Z顺序的底部。这也将是巨大的,如果它可以留在桌面上,即使用户做一个最小化所有或显示桌面操作。

Does anybody know how to make a 'always-on-bottom'-windows, or a window pinned to the desktop? It should receive focus and mouseclicks, but should stay at the bottom of the Z-order. It would also be great if it could stay on the desktop even when user do a minimize all or show desktop operation.

这两种Delphi和C#的解决方案(或部分解决方案/提示)将是巨大的。

Both delphi and c# solutions (or partial solutions/hints) would be great.

推荐答案

警告有人建议,可以通过调用的setparent并设置窗口为桌面的孩子做到这一点。如果你这样做,可以使Win32的窗口管理器到桌面的输入队列相结合,你的子窗口,这是一个的坏事的 - 的雷蒙德陈解释了原因。

Warning It was suggested that you can accomplish this by calling SetParent and setting the window to be a child of the Desktop. If you do this, you cause the Win32 Window Manager to combine the input queue of the Desktop to your child window, this is a bad thing - Raymond Chen explains why.

另外,请记住,调用SetWindowPos与HWND_BOTTOM是不完整的。你需要做这个,只要您的窗口正在改变ZORDER。处理WM_WINDOWPOSCHANGING事件,看看SWP_NOZORDER获取更多信息。

Also, keep in mind that calling SetWindowPos with HWND_BOTTOM is incomplete. You need to do this whenever your window is changing zorder. Handle the WM_WINDOWPOSCHANGING event, look at SWP_NOZORDER for more info.

这篇关于如何使“始终位于bottom'窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆