Is it possible to programmatically prevent a game from pausing when its window loses focus?

I play Skyrim in windowed mode and I am trying to create a bot for this game for personal use. I would like the bot to play the game in the background, and I am doing other things, the only problem is that the game window pauses when it loses focus. Is there a way to make the Skyrim process think that it still has focus, so it continues to work while I do something else in another window? I'm not an expert on Windows programming, but is it possible if I could somehow intercept a message that says it is unfocused or minimized, and thus let the process think that it is still focused?

+6
source share
1 answer

It is possible. You need to find the mechanism by which the game checks to see if it in the foreground will trick it into thinking that the switch did not happen. This will require a certain amount of reverse engineering on your part. There are many different ways that this check can actually be performed in the game.

You can try playing with the connection of one of the following messages / functions: WM_KILLFOCUS , WM_ACTIVATE , GetForegroundWindow . On the other hand, a game might do something funky with DirectX. I don't have much experience.

To repeat the iteration, to do it right, you really need to figure out exactly how the game will test (and then undermine it).

+6
source

Source: https://habr.com/ru/post/912859/


All Articles