English
Regulars table & Café

CreateToolhelp32Snapshot.

 


Description:

CreateToolhelp32Snapshot power a Schnappschuß of ongoing Prozessen, Threads and DLL’s.




Deklaration:

Def @CreateToolhelp32Snapshot(2) !kernel32,CreateToolhelp32Snapshot




Parameter:

1.Parameter: ? Happen?, The The manner the Schnappschusses to determine as LongIntwert. ? Happen? can with | add go =>
-$80000000 = Schnappschußhandle can vererbt go.
-$4 = Threadliste becomes created.
-$2 = Prozessliste becomes created.
-$8 = From one Process loaded DLL’s go gelistet.
-$1 = Created Heapliste one Prozesses.
2.Parameter: ID one Prozesses (0 for actually Process). If $8 or $1 not specify get, has this Parameter no weight.



Return Value:

Open lever on the Schnappschuß.


Examples:

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#)
        messagebox(str$(GetLastError()),"Err",48)
        messagebox(str$(Result&),str$(hSnapshot&),48)

        While Result&

            messagebox(Lower$(Right$(PROCESSENTRY#.szExeFile$,lenname&)),"",48)

            if Lower$(Right$(PROCESSENTRY#.szExeFile$,lenname&)) = prozess$

                if delete% = 1

                    hProcess& = @OpenProcess(&PROCESS_TERMINATE, 0, PROCESSENTRY#.th32ProcessID&)
                    sendmessage(hProcess&,$0010,0,0)
                    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 s3>"Notepad.exe",1

[keywords:2a51069288]
Tasks processes lists List Taskmanager DLLs Threads Show
[/keywords:2a51069288]
 
03/06/05  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.886 Views

Untitledvor 0 min.
iF07/07/15

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