vb如何用快捷键结束某进

2025-05-23 20:03:45
推荐回答(1个)
回答(1):


Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
  If GetAsyncKeyState(65) = -32767 Then
    If GetAsyncKeyState(17) = -32767 Then
      'Shell "taskkill.exe /f /im myname.exe"这里写结束进程      
    End If
  End If
End Sub