Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub EndTask2(ByVal Caption As String)
On Error Resume Next
Handle = FindWindow(vbNullString, Caption)
If Handle = 0 Then Exit Sub
SendMessage Handle, &H10, 0&, 0&
End Sub
Private Sub Command1_Click()
EndTask2 InputBox("Type title of program",Me.Caption)
End Sub
فقط یه دکمه رو فرمتون بذارین همه چیز حل میشه