如何使“永远在底”的窗口 [英] How to make 'always-on-bottom'-window

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

问题描述

有没有人知道如何制作一个永远在底的窗口,还是一个固定在桌面上的窗口?它应该得到焦点和mouseclick,但应该保持在Z顺序的底部。即使用户尽量减少全部或显示桌面操作,它也可以保留在桌面上。



delphi和c#解决方案(或部分解决方案/提示) )

解决方案

警告建议您可以通过调用SetParent和将窗口设置为桌面的孩子。如果这样做,您会导致Win32窗口管理器将桌面的输入队列与您的子窗口组合,这是一个坏的东西 - Raymond Chen解释为什么。



另外,保持介意使用HWND_BOTTOM调用SetWindowPos是不完整的。当你的窗口改变zorder时,你需要这样做。处理WM_WINDOWPOSCHANGING事件,查看SWP_NOZORDER了解更多信息。


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.

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

解决方案

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.

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.

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

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