6

我在窗口模式下玩天际,我正在尝试为这个游戏创建一个机器人供个人使用。我想让机器人在后台玩游戏,而我做其他事情时,唯一的问题是游戏窗口在失去焦点时会暂停。有没有办法让天际进程认为它仍然有焦点,所以当我在另一个窗口上做其他事情时它会继续运行?我不是 Windows 编程专家,但如果我能以某种方式截取对进程说未集中或最小化的消息,从而让进程认为它仍然集中,这可能吗?

4

1 回答 1

6

It's possible. You need to find the mechanism through which the game checks whether it's in the foreground then trick it into thinking the switch has not occurred. This will require a certain amount of reverse engineering on your part. There are many different ways that this checking can actually be done by the game.

You can try to play with hooking one of the following messages/functions: WM_KILLFOCUS, WM_ACTIVATE, GetForegroundWindow. On the other hand, the game might be doing something funky with DirectX. I don't have much experience there.

To re-iterate, to do this properly you are really going to have to find out exactly how the game does the checking (and then subvert that).

于 2012-04-10T15:20:49.437 回答