English
Source / code snippets

Killen Process

 
deference! Entlädt no of Process loaded DLLs...
CompileMarkSeparation
Def @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
 
02/26/05  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.207 Views

Untitledvor 0 min.
AndreasS11/27/18
Tango07/21/17
W.L.07/05/17
Kermit04/27/16
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie