如何制作“始终在底部"的窗口 [英] How to make 'always-on-bottom'-window

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

问题描述

有人知道如何制作始终在底部"的窗口,或固定到桌面的窗口吗?它应该接收焦点和鼠标点击,但应该停留在 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 窗口管理器将桌面的输入队列合并到你的子窗口,这是一件坏事 - Raymond Chen 解释了原因.

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.

另外,请记住,使用 HWND_BOTTOM 调用 SetWindowPos 是不完整的.每当您的窗口更改 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.

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

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