Home > Back-end >  Under Windows how to judge a process through the code really thoroughly didn't respond?
Under Windows how to judge a process through the code really thoroughly didn't respond?

Time:09-20

Baffled all programming master asked a question: how to judge a process through the code under Windows really has no response?

CodePudding user response:

First, defining the concept of no response...

CodePudding user response:

Is not response to connect, or unable to switch to normal display software and interface

CodePudding user response:

Can use Windows API function: IsHungAppWindow (user32. DLL), to determine whether the application response, however, the MSDN tip this function may change or delete in future versions, do best judgment, SendMessageTimeout sends WM_NULL message can also judge that window () function checks whether the response,

CodePudding user response:

Is there any other way?

CodePudding user response:

SendMessageTimeout function sends WM_NULL message might be wrongly

CodePudding user response:

The mentioned two ways are the MSDN, is relatively simple, the boundaries of response does not response is not so distinct, if there is a misjudgment, scoring a variety of situations, the critical value the need to adjust, the software is constantly updated development, don't have enough once and for all, figure out whether connection response, link directly to determine the return value is the easiest way,

CodePudding user response:

If they were all write their own programs, to be a watchdog. Dog will not howl, you die!

CodePudding user response:

But not every program with a dog

CodePudding user response:

Use the IsHungAppWindow

CodePudding user response:

Thread for a heartbeat, heart stopped, it also died,

CodePudding user response:

The enumeration process, process ID, WaitForSingleObject whether there is a decision process

CodePudding user response:

Process ID does not exist is to say, but if the actual process has no response of the process ID, this is the problem to be solved by this post,

CodePudding user response:

Thread for a heartbeat, heart stopped, and it also died
This I do not know the specific realization method, whether to send controlled thread heartbeat package? Not please elaborate

CodePudding user response:

refer to 12 floor Tugangw2000 reply:
process ID does not exist is to say, but if the actual process has no response of the process ID, this is the problem to be solved by this post,

You constructed above the misjudgment of both ways? Where do you think the boundary of the no response? Such as overtime time, no feedback message or return a result,

CodePudding user response:

Does have some difficulty, but I believe that there is a way

CodePudding user response:

I can't believe how a problem is baffled all the heroes of the world, could IT warrior

CodePudding user response:

I'm afraid that is not a question of actual application, see someone on a technical BBS recently raised a question: how to create a DLL, which can be invoke all the language result shut down by the editor, the reason is that it is not a specific issue, it's vague, too broad, incomplete,
A discrimination problems and falsifiable should have boundaries, and can be validated and the operation, and so should clarify concepts first, construct the concrete problem need to solve,

CodePudding user response:

Problem is not clear enough?
  • Related