Process Start colse kill
*
Imports System.Diagnostics
Public Class Form1

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Process.Start("notepad.exe")
End Sub

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
' 모두 종료
Do Until Process.GetProcessesByName("notepad").Count < 1
For Each p As Process In Process.GetProcessesByName("notepad")
p.CloseMainWindow()
Next
Loop
End Sub

Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
For Each p As Process In Process.GetProcessesByName("notepad")
p.Kill()
p.Close()
Next
End Sub

Private Sub ListBox_Items()
ListBox1.Items.Clear()
For Each p As Process In Process.GetProcesses
If Not ListBox1.Items.Contains(p.ProcessName) Then
ListBox1.Items.Add(p.ProcessName)
End If
Next
ListBox1.Sorted = True
End Sub

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
ListBox_Items()
End Sub
End Class

assasa.PNG

 

이 게시물을

댓글'1'
VNote (작성자)
  • 2020.05.01
  • 수정: 2020.05.01 13:55:12

   Dim ProcID As Integer

        Dim NOTEPADtemp As String = "NOTEPAD.EXE c:\aa.txt"

        ProcID = Shell(NOTEPADtemp, AppWinStyle.NormalFocus)

        AppActivate(ProcID)

   

        SendKeys.SendWait(ProcID)

    

        Dim aProcess As System.Diagnostics.Process

        aProcess = System.Diagnostics.Process.GetProcessById(ProcID)

        aProcess.Kill()

 

이 댓글을

공유하기

SEARCH

MENU NAVIGATION