// JP opened flex table

Click to See Complete Forum and Search --> : Monitor an application - kill and regenerate if hang


Yijie
September 19th, 2007, 09:39 PM
Hi all,
Do need a favour here. I would like to monitor an application and kill it if it is hang and regenerate it. However, not able to find relevant code.
I'm able to get the kernel and user time by "getprocesstime". But not able to monitor the CPU usage (not able to get idle time) to kill the hang program.Understand that some programmer use "GetSystemTimes" function. But it does not work in my PC.
Any suggestion or free code to share? Thanks a lot!

JVene
September 19th, 2007, 11:33 PM
Google Windows Performance Monitor (maybe with C++ in there), and scan through for code examples.

However, some programs hang in such a way that no CPU time is occupied, which looks like any otherwise functioning program that's just waiting.

Arjay
September 20th, 2007, 01:20 AM
Double posted. See my response in the other forum.

//JP added flex table