Windows 7: Prevent application from losing focus

北战南征 提交于 2021-02-17 19:08:10

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/7430864/windows-7-prevent-application-from-losing-focus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!