今天看了资料,有一个函数可以实现这个功能的,只是平时没有看。
IsHungAppWindow
You call the IsHungAppWindow function to determine if Microsoft Windows considers that a specified application is not responding. An application is considered to be not responding if it is not waiting for input, is not in startup processing, and has not called <link tabindex="0" keywords="_win32_PeekMessage_cpp" xmlns:mshelp="http://msdn.microsoft.com/mshelp"> within the internal timeout period of 5 seconds.
Returns TRUE if the window stops responding, otherwise returns FALSE. Ghost windows always return TRUE.