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
Private Sub Timer1_Timer()
If FindWindow(vbNullString, "标题") <> 0 Then '判断程序是否运行
If IsHungAppWindow(FindWindow(vbNullString, "标题")) = 1 Then '如果程序未响应
Me.Caption = "程序未响应"
Else '如果程序运行正常
Me.Caption = "程序运行正常"
End If
Else '如果程序没有运行
Me.Caption = "程序未运行"
End If
End Sub