I'm making a process viewer and it works fine, but there are apps I cant close.
Also I'd like to know how to find out if a apllication responds.

I tried this to close a process:
Code:
Public Sub KillProcess( iProcess As ProcessEntry32 )
    Dim Temp As Long
    Dim hWnd As Long

    'Find process and exit
    hWnd = GetProcessHandle(iProcess)
    
    While hWnd <> 0
        Temp = SendMessage( hWnd, WM_CLOSE, 0, 0& )
        
        'If I want to close some apps Temp is always 0...
        If Temp = 0 Then
            hWnd = GetProcessHandle( iProcess )
        Else
            hWnd = 0
        End If
    Wend
End Sub
I tries to find out about response like this:
Code:
Temp = SendMessageTimeout(GetProcessHandle( Process(A) ), WM_NULL, 0, 0, SMTO_ABORTIFHUNG Or SMTO_BLOCK, 2000, Temp )

If Temp = 0 Then
    Caption = "Process #" & A & " doesn't response"
End If
Thanks in advance!

[Edited by Fox on 05-04-2000 at 08:41 PM]