VB 判断某窗口是否出错、挂起、无响应,IsHungAppWindow 函数功能详解,使用实例:

Private Declare Function IsHungAppWindow Lib "user32.dll" (ByVal hWnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

'IsHungAppWindow:参数只有一个,目标窗口的句柄.
'返回值:当句柄无效或句柄所标识的窗体的消息循环是正常的,则返回0,否则返回1,代表无响应.
Private Sub Command1_Click()
    MsgBox IsHungAppWindow(FindWindow(vbNullString, "123"))
End Sub