Windows 7:防止应用程序失去焦点
我有一个用 C++ 编写的 Windows 7 自制全屏应用程序,它应该作为公开演示自行运行很长时间。
问题是,有几个应用程序或驱动程序或 Windows 本身会不时和/或特别是在系统启动时窃取焦点。 结果是:我的全屏应用程序被最小化。
这是非常烦人的,而且几乎不可能总是找出你必须停用哪些东西来防止这种情况。特别是因为有时需要那些窃取焦点的东西,例如触摸屏驱动程序。
我可以做什么来防止失去焦点?
或者甚至更好:如何防止其他应用程序窃取焦点 - 我记得 Windows XP 的 TweakUI 中曾经有过这样的设置。
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.
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?
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Tweak UI 通过更改 SPI_SETFOREGROUNDLOCKTIMEOUT 来实现此目的。您可以将其与 LockSetForegroundWindow 结合使用。
Tweak UI does it by changing the
SPI_SETFOREGROUNDLOCKTIMEOUT
. You can combine this withLockSetForegroundWindow
.