Python-Windows-将程序保留在另一个全屏应用程序的顶部 [英] Python - Windows - Keep Program On Top Of Another Full Screen Application

查看:66
本文介绍了Python-Windows-将程序保留在另一个全屏应用程序的顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以运行我的程序,使其始终位于最前面.即使正在运行全屏应用程序(例如游戏或视频)?

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?

推荐答案

您可以使用

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,

我们已经知道您无法创建始终位于最上方的窗口,即使存在其他标记为始终在顶部的窗口.一个如果两个程序执行了该怎么办?"的应用程序规则证明这是不可能的,因为无论您使用什么技巧总是在另一个之上,另一个程序可以使用相同的技巧,并且现在您有两个始终位于顶部的窗口,会发生什么?

We already know that you can't create a window that is always on top, even in the presence of other windows marked always-on-top. An application of the "What if two programs did this?" rule demonstrates that it's not possible, because whatever trick you use to be on-top-of-always-on-top, another program can use the same trick, and now you have two on-top-of-always-on-top windows, and what happens?

但是,有一些小希望.他继续写作,

However, there is some small hope. He goes on to write,

唯一明智的出路是让程序合作确定在任何特定时间由谁控制屏幕.

The only sane way out is to have the programs coöperate to determine who is in control of the screen at any particular time.

实际上,这可以通过以下几种方式实现:

Practically speaking, this is achievable in a few ways:

  • 召集游戏程序和视频程序的开发人员,并要求他们将代码添加到他们的系统中,以检查您的窗口是否存在,并且不要使用最顶层的属性.
  • 成为游戏程序和视频程序的开发人员,并自己添加检查代码.
  • 成为操作系统的创建者,所有这些程序都在其上运行,并为您的程序提供排他性的超级最高"特权.

这篇关于Python-Windows-将程序保留在另一个全屏应用程序的顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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