16,721
社区成员




Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Integer, ByRef lpdwProcessId As Integer) As Integer
...
Dim t As IntPtr = New IntPtr(objExcel.Hwnd)
Dim k As Integer
GetWindowThreadProcessId(t, k)
System.Diagnostics.Process.GetProcessById(k).Kill()