i use a small purebasic-tool to launch a game application. if that application crashes, it should relaunch the game.
but if the game hangs, or it has recently crashed but does not register as not-running because that stupid "app has crashed/stopped working" box is blocking it, IsProgram and ProgramRunning seem to be useless.
i found a registry key for vista/7 to disable that box, however it's certainly not a nice thing to do, and it does not work on xp.
i'd really appreciate if somebody could help me out here.
need to detect a hanging application
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: need to detect a hanging application
You need to enumerate all the processes and test for activity. I have not done this using PB, but I expect someone on this forum has.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: need to detect a hanging application
good call. i can enumerate all processes by using PBOSL_Process, but how can i scan it for activity?
Re: need to detect a hanging application
Maybe it helps, try IsHungAppWindow_() -> http://msdn.microsoft.com/en-us/library ... 85%29.aspx
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Re: need to detect a hanging application
You can also check the process thread activity, if there is no activity in the thread then its hung most likely. The majority of games have lots of activity in their threads just setting idle.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.

