Admin Admin
Mesaj Sayısı : 63 Tecrübe Puanı : 173 Kayıt tarihi : 12/07/10
| Konu: Çalışan Programı Kapat(Kodlar) Salı Tem. 13, 2010 2:55 pm | |
| Yeni bir form açın ve forma 1 ListBox ve bir CommandButton ekleyin code kısmınada aşşağıdaki yazıyı olduğu gibi kopyalayın. - Kod:
-
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long Private Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long Private Declare Function TerminateProcess Lib "kernel32" (ByVal ApphProcess As Long, ByVal uExitCode As Long) As Long Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Type PROCESSENTRY32 dwSize As Long cntUsage As Long th32ProcessID As Long th32DefaultHeapID As Long th32ModuleID As Long cntThreads As Long th32ParentProcessID As Long pcPriClassBase As Long dwFlags As Long szExeFile As String * 260 End Type
Dim lSnapShot As Long, lNextProcess As Long, Program As PROCESSENTRY32
Private Sub Command1_Click() TerminateProcess OpenProcess(0, False, Val(List1.Text)), lExitCode DoEvents List1.Clear Bul End Sub
Private Sub Form_Load() Bul End Sub
Private Sub Bul() lSnapShot = CreateToolhelp32Snapshot(&H2&, 0&) Program.dwSize = Len(Program) lNextProcess = Process32First(lSnapShot, Program) Do While lNextProcess List1.AddItem Program.th32ProcessID & " " & Program.szExeFile lNextProcess = Process32Next(lSnapShot, Program) Loop End Sub | |
|