问题
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