How to check whether a program is running or hung
hi,
I am writing a small program A to check whether program B is running or hung. I am using the SendMessageTimeout to get reply from the program B to check for it, as the follow:
nret = SendMessageTimeout(mlngFTPhWnd, WM_GETTEXTLENGTH, 0&, ByVal 0&, SMTO_BLOCK, 5000, lpdwResult)
But I found a problem with this, supppose program B is running and doing some heavy processing so program B may return unsuccessful value to program A and program A will defined program B is hung, but actually it is not. :(
How am I going to resolve this? any other solution beside using SendMessageTimeout?
Advanced thanks for those who able to help.
|