By Mohammed Sayed Mohammed.
http://www.freewebs.com/msayed/

Function Name : IsHungAppWindow

Library : user32

OS : MS 2000 Minimum

Description : 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 PeekMessage within the internal timeout period of 5 seconds.

Declarations : Declare Function IsHungAppWindow Lib "user32" (ByVal hwnd As Long) As Long

Parameters :
	hwnd : [in] Handle to the window.

Return Values :
	Returns TRUE if the window stops responding, otherwise returns FALSE. Ghost windows* always return TRUE.

Example :
	'-Code : ----------
	Option Explicit
	Private Declare Function IsHungAppWindow Lib "user32" (ByVal hwnd As Long) As Long
	Private Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long

	Private Function IsNotResponding(wHwnd As Long) As Boolean
	If IsWindow(wHwnd) <> 0 Then
	        IsNotResponding = CBool(IsHungAppWindow(wHwnd))
	    Else
	        Err.Raise 5, , Error(5) & vbNewLine & "You should provide a handle that identifies an existing window."
	End If
	End Function

	Private Sub Form_Load()
		MsgBox IsNotResponding(Me.hwnd)
	End Sub
	'-End ----------

Resources :
	http://msdn2.microsoft.com/en-us/library/ms633526.aspx
	http://support.microsoft.com/kb/190000/en-us

* Ghost windows :
	http://support.microsoft.com/kb/817611/