hi mrcool4444,
The following code can give you a hint to kill the process.
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Sub Command2_Click()
If MsgBox("Are you sure to cancel the process?", vbYesNo, "Cancel Process") = vbYes Then
KillApplication "WINWORD"
End If
End Sub
Private Sub KillApplication(processNam
On Error GoTo erlevel
Dim winHwnd As Long
Dim RetVal As Long
winHwnd = FindWindow(vbNullString, processName)
If winHwnd <> 0 Then
RetVal = PostMessage(winHwnd, &H10, 0&, 0&)
End If
erlevel:
End Sub
wilson
Main Topics
Browse All Topics





by: sk33v3Posted on 2002-08-14 at 22:11:28ID: 7221741
Well I guess you could find the process Id associated with it and close the process.