View previous topic :: View next topic |
Author |
Message |
Ultraplayer Newbie cheater Reputation: 0
Joined: 06 Apr 2019 Posts: 20
|
Posted: Tue Mar 16, 2021 2:46 am Post subject: How to catch the loss of focus of the game window |
|
|
Many games such as Fallout 4 have a handler that monitors when the user switches a task and pauses the game. Any ideas how to find this handler?
|
|
Back to top |
|
|
sbryzl Master Cheater Reputation: 6
Joined: 25 Jul 2016 Posts: 252
|
Posted: Tue Mar 16, 2021 2:48 pm Post subject: |
|
|
Find what the window handle is (hwnd). All programs including games have many ops and variables that track the hwnd. For instance it might call GetWindowInfo which requires the hwnd.
Once you know the handle, search for it in memory and find what accesses it when the window is active and inactive and it should become apparent how to distinguish them.
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Tue Mar 16, 2021 3:15 pm Post subject: Re: How to catch the loss of focus of the game window |
|
|
Any specific reason?
You could hook wndproc if you are doing something externally.
Otherwise you could just check if there anything that is being toggled(1 or 0) whenever window get deactivated/activated.
Attach to game, set in cheatengine hotkeys, pause/unpack hotkey.
Go to game, press hotkey (to pause), go back to ce, scan 1, un-pause game, scan 0 and repeat...
_________________
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Tue Mar 16, 2021 3:34 pm Post subject: |
|
|
This is generally done in the games WNDPROC. You can breakpoint on things like:
- DefWindowProcA / DefWindowProcW
- CallWindowProcA / CallWindowProcW
And trace back from there. Generally, this will probably be handled via the WM_ACTIVATE message or the WM_KILLFOCUS/WM_SETFOCUS messages.
_________________
- Retired. |
|
Back to top |
|
|
Ultraplayer Newbie cheater Reputation: 0
Joined: 06 Apr 2019 Posts: 20
|
Posted: Tue Mar 16, 2021 4:08 pm Post subject: Re: How to catch the loss of focus of the game window |
|
|
DaSpamer wrote: | Any specific reason? |
Just for convenience. Thanks for the advice
atom0s wrote: | This is generally done in the games WNDPROC... |
Thanks for the advice
|
|
Back to top |
|
|
|