Windows 7:防止应用程序失去焦点 [英] Windows 7: Prevent application from losing focus

查看:75
本文介绍了Windows 7:防止应用程序失去焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用C ++编写的用于Windows 7的自制全屏应用程序,应作为公共演示文稿长时间运行.

I have a self-made fullscreen application for Windows 7 written in C++ which should run for a long time on its own as a public presentation.

问题是,有一些应用程序或驱动程序或Windows本身不时地(尤其是在系统启动时)失去了焦点.结果是:我的全屏应用程序被最小化了.

Problem is, there are several applications or drivers or Windows itself that steal focus from time to time and/or especially at system startup. Result is: My fullscreen application gets minimimized.

总是要找出必须停用的东西来防止这种情况非常烦人,几乎是不可能的.尤其是因为有时需要那些专注于偷东西的人,例如触摸屏驱动程序.

It is very annoying and nearly impossible to always find out which things you have to deactivate to prevent that. Especially because those focus stealing things are sometimes needed, e.g. touchscreen drivers.

我该怎么做才能防止失去焦点?

What can I do to prevent losing focus?

或更妙的是:如何防止其他应用程序失去焦点-我记得Windows XP的TweakUI中曾经有过这样的设置.

Or even better: How can I prevent other applications from stealing focus - I remember there once was such a setting in TweakUI for Windows XP.

推荐答案

调整UI通过更改 SPI_SETFOREGROUNDLOCKTIMEOUT 来实现.您可以将其与 LockSetForegroundWindow 组合.

Tweak UI does it by changing the SPI_SETFOREGROUNDLOCKTIMEOUT. You can combine this with LockSetForegroundWindow.

这篇关于Windows 7:防止应用程序失去焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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