Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

"Ubijanje" procesa.

[es] :: Visual Basic 6 :: "Ubijanje" procesa.

[ Pregleda: 5774 | Odgovora: 7 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

b3|2A

Član broj: 28083
Poruke: 84
*.as58.ob.bih.net.ba.



Profil

icon "Ubijanje" procesa.26.07.2004. u 23:17 - pre 239 meseci
Da li neko zna kako da "ubijem" neki proces?
 
Odgovor na temu

mladenovicz
Zeljko Mladenovic
Xoran Technologies, Inc., Ann Arbor, MI,
USA / Software Engineer
Ann Arbor, MI, USA

Član broj: 6598
Poruke: 2065
*.bg.wifi.vline.verat.net.

Jabber: mladenovicz@elitesecurity.org
ICQ: 95144142
Sajt: yubc.net/~mz


Profil

icon Re: "Ubijanje" procesa.28.07.2004. u 11:01 - pre 239 meseci
Skini API Guide, instaliraj, pokreni, odaberi Group prikaz i u Process cvoru imas funkcije za rad sa procesima, izmedju ostalog i TerminateProcess
 
Odgovor na temu

VRKY

Član broj: 21087
Poruke: 4690
*.net.htnet.hr



+8 Profil

icon Re: "Ubijanje" procesa.03.08.2004. u 10:16 - pre 239 meseci
Ovo stavi u obični moduel:

Code:

Option Explicit
Private Declare Function CloseHandle Lib "Kernel32.dll" (ByVal Handle As Long) As Long
Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, lProcessID As Long) As Long
Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function GetVersionExA Lib "kernel32" (lpVersionInformation As OSVERSIONINFO) As Integer
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
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Const PROCESS_ALL_ACCESS = 0
Private Const TH32CS_SNAPPROCESS As Long = 2&
Private Const WINNT As Integer = 2
Private Const WIN98 As Integer = 1
Public KillAppReturn As Boolean
Public Function getVersion() As Integer
Dim udtOSInfo As OSVERSIONINFO
Dim intRetVal As Integer
     
With udtOSInfo
    .dwOSVersionInfoSize = 148
    .szCSDVersion = Space$(128)
End With

intRetVal = GetVersionExA(udtOSInfo)

getVersion = udtOSInfo.dwPlatformId
End Function

Public Function Killapp(myName As String)
Select Case getVersion()
Case WIN98
Killapp9X (myName)
Case WINNT
KillappNT (myName)
End Select
End Function

Private Function KillappNT(myName As String)
Dim uProcess As PROCESSENTRY32
Dim rProcessFound As Long
Dim hSnapshot As Long
Dim szExename As String
Dim exitCode As Long
Dim myProcess As Long
Dim AppKill As Boolean
Dim appCount As Integer
Dim I As Integer
On Local Error GoTo Finish
appCount = 0
uProcess.dwSize = Len(uProcess)
hSnapshot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&)
rProcessFound = ProcessFirst(hSnapshot, uProcess)
Do While rProcessFound
    I = InStr(1, uProcess.szExeFile, Chr(0))
    szExename = LCase$(Left$(uProcess.szExeFile, I - 1))
    If Right$(szExename, Len(myName)) = LCase$(myName) Then
        KillAppReturn = True
        appCount = appCount + 1
        myProcess = OpenProcess(1&, -1&, uProcess.th32ProcessID)
        AppKill = TerminateProcess(myProcess, 0&)
        Call CloseHandle(myProcess)
    End If
    rProcessFound = ProcessNext(hSnapshot, uProcess)
Loop
Call CloseHandle(hSnapshot)
Finish:
KillAppReturn = False
End Function

Private Function Killapp9X(myName As String)
Dim uProcess As PROCESSENTRY32
Dim rProcessFound As Long
Dim hSnapshot As Long
Dim szExename As String
Dim exitCode As Long
Dim myProcess As Long
Dim AppKill As Boolean
Dim appCount As Integer
Dim I As Integer
On Local Error GoTo Finish
appCount = 0
uProcess.dwSize = Len(uProcess)
hSnapshot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&)
rProcessFound = ProcessFirst(hSnapshot, uProcess)
Do While rProcessFound
    I = InStr(1, uProcess.szExeFile, Chr(0))
    szExename = LCase$(Left$(uProcess.szExeFile, I - 1))
    If Right$(szExename, Len(myName)) = LCase$(myName) Then
        KillAppReturn = True
        appCount = appCount + 1
        myProcess = OpenProcess(PROCESS_ALL_ACCESS, False, uProcess.th32ProcessID)
        AppKill = TerminateProcess(myProcess, exitCode)
        Call CloseHandle(myProcess)
    End If
    rProcessFound = ProcessNext(hSnapshot, uProcess)
Loop
Call CloseHandle(hSnapshot)
Finish:
KillAppReturn = False
End Function


I onda u formi ovo.. primjer je za Notepad:

Code:

Killapp "notepad.exe"
 
Odgovor na temu

VRKY

Član broj: 21087
Poruke: 4690
*.net.htnet.hr



+8 Profil

icon Re: "Ubijanje" procesa.25.09.2004. u 22:35 - pre 237 meseci
Code:

Open C:\ES.bat" For Output As #1
Print #1, "taskkill /F /IM notepad.exe"
Close
 
Odgovor na temu

Shadowed
Vojvodina

Član broj: 649
Poruke: 12846



+4783 Profil

icon Re: "Ubijanje" procesa.26.09.2004. u 00:11 - pre 237 meseci
Code:
Shell("taskkill /F /IM notepad.exe")   ';)

Ovo ne radi na Win9x platformama.
 
Odgovor na temu

VRKY

Član broj: 21087
Poruke: 4690
*.net.htnet.hr



+8 Profil

icon Re: "Ubijanje" procesa.26.09.2004. u 08:37 - pre 237 meseci
Znam...
Evo još jedan način:

Code:

Dim app_list(1 To 2, i As Integer
Dim name, num

app_list(1) = "notepad.exe"
app_list(2) = "calc.exe
num = 2
For i = 1 To num
   name = app_list(i)
   For Each process In GetObject("winmgmts:"). _
       ExecQuery("select name from Win32_Process where name='" & name & "'")
       process.Terminate (0)
   Next


 
Odgovor na temu

cyBerManIA
I ovo T ono
Space

Član broj: 25195
Poruke: 698
81.169.226.*

Sajt: www.facebook.com/cyberman..


+263 Profil

icon Re: "Ubijanje" procesa.27.09.2004. u 10:41 - pre 237 meseci
Taskkill ne postoji na WinXP Home ,2000 pro,2000 Server , 2003 server,i naravno win9x

eto male pomoci
 
Odgovor na temu

Shadowed
Vojvodina

Član broj: 649
Poruke: 12846



+4783 Profil

icon Re: "Ubijanje" procesa.27.09.2004. u 11:25 - pre 237 meseci
Ako zanemarimo sve ostale, hoces da kazes da ga nemas na 2003-ci???
 
Odgovor na temu

[es] :: Visual Basic 6 :: "Ubijanje" procesa.

[ Pregleda: 5774 | Odgovora: 7 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.