| |
|
|
| Achtung! Entlädt keine vom Prozess geladenen DLL... KompilierenMarkierenSeparierenDef @CreateToolhelp32Snapshot(2) !"kernel32","CreateToolhelp32Snapshot"
Def @Process32First(2) !"kernel32","Process32First"
Def @Process32Next(2) !"kernel32","Process32Next"
Def @CloseHandle(1) !"kernel32","CloseHandle"
Def @TerminateProcess(2) !"kernel32","TerminateProcess"
Def @OpenProcess(3) !"kernel32","OpenProcess"
Def &TH32CS_SNAPPROCESS 2
Def &PROCESS_TERMINATE 1
Declare PROCESSENTRY#
Struct PROCESSENTRY32 =dwSize&,cntUsage&,th32ProcessID&,th32DefaultHeapID&,th32ModuleID&,cntThreads&,th32ParentProcessID&,pcPriClassBase&,dwFlags&,szExeFile$(260)
Proc actua
parameters prozess$, delete%
declare lenname&
declare hSnapshot&, Result&, hProcess&, proz_anzahl&, term_ok&
Dim PROCESSENTRY#, PROCESSENTRY32
Long PROCESSENTRY#,0 =296
clear proz_anzahl&, term_ok&
lenname& = len(prozess$)
prozess$ = Lower$(prozess$)
hSnapshot& = CreateToolhelp32Snapshot(&TH32CS_SNAPPROCESS, 0)
IfNot hSnapshot& = -1
Result& = Process32First(hSnapshot&, PROCESSENTRY#)
While Result&
if Lower$(Right$(PROCESSENTRY#.szExeFile$,lenname&)) = prozess$
if delete% = 1
hProcess& = @OpenProcess(&PROCESS_TERMINATE, 0, PROCESSENTRY#.th32ProcessID&)
term_ok& = @TerminateProcess(hProcess&, 0)
@CloseHandle(hProcess&)
sleep 100
endif
proz_anzahl& = proz_anzahl& + (delete%<>1) + term_ok&
endif
Result& = Process32Next(hSnapshot&, PROCESSENTRY#)
EndWhile
endif
@CloseHandle(hSnapshot&)
Dispose PROCESSENTRY#
return proz_anzahl&
Endproc
@WinEXEC("NotePad.exe",1)
Sleep 10000
actua uot;Notepad.exe",1
|
|
|
| |
|
|