Detect terminated / hung target and reflect it in the UI
The Injection panel kept showing "Attached" after the game exited. Now it tracks target liveness each frame (InjectionPanel::tick from the main loop, independent of panel visibility): - a SYNCHRONIZE|QUERY process handle taken at inject time -> WaitForSingleObject detects the process exiting (Terminated); - the hook heartbeat stalling for ~2 s while the process still exists flags a distinct Hung state (games here can freeze without exiting). The panel shows a clear colored banner per state and disables the subsystem hook/unhook controls and the synthetic-input toggle when the target isn't alive. game_hwnd() returns null once Terminated, so the Video and Audio panels drop to idle instead of chasing a dead window. Verified: x64 build + ctest 7/7 green; host launches and renders the panels without regression (screenshot smoke test). The interactive terminated/hung visual against a real game is best confirmed in a live session (ImGui injection can't be GUI-scripted). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -145,6 +145,7 @@ int run()
|
||||
#endif
|
||||
input->poll();
|
||||
injection.publish(input->pads());
|
||||
injection.tick(); // refresh target liveness before the mirror panels read game_hwnd()
|
||||
const HWND game = injection.game_hwnd();
|
||||
capture.set_target(game);
|
||||
audio.set_target(game);
|
||||
|
||||
Reference in New Issue
Block a user