问题描述
是否可以运行我的程序,使其始终位于最前面.即使正在运行全屏应用程序(例如游戏或视频)?
Is it possible to have my program running so that it is always on top. Even when there is a full screen application running, such as a game or video?
推荐答案
您可以使用 SetWindowPos 可以将窗口置于最高位置,但是任何要求居于窗口最高位置的程序都可以将其获取,并绘制在窗口上方.
You can use SetWindowPos to make your window topmost, but any program that asks to be topmost after yours will get it, and draw over your window.
不可能在所有其他窗口的顶部都创建一个总是 的窗口.在他的文章中,如何创建最顶部的窗口从未被其他最顶层的窗户覆盖吗?,雷蒙德·陈(Raymond Chen)写道,
It's impossible to make a window that is always on top of every other window. In his article, How do I create a topmost window that is never covered by other topmost windows?, Raymond Chen writes,
但是,有一些小希望.他继续写作,
However, there is some small hope. He goes on to write,
实际上,这可以通过以下几种方式实现:
Practically speaking, this is achievable in a few ways:
- 召集游戏程序和视频程序的开发人员,并要求他们将代码添加到他们的系统中,以检查您的窗口是否存在,并且不要使用最顶层的属性.
- 成为游戏程序和视频程序的开发人员,并自己添加检查代码.
- 成为操作系统的创建者,所有这些程序都在其上运行,并为您的程序提供排他性的超级最高"特权.
这篇关于Python-Windows-将程序保留在另一个全屏应用程序的顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!