English
Source / code snippets

Createtoolhelp32snapshot Kernel32 Killprocess Process Terminieren

 
Andreas Miethe (09.02.13)

in the Context same yet something.
around the To testing must the Explorer new launched go.

the goes so :
CompileMarkSeparation
Proc KillProcess

    Var Kernel& = Importdll("Kernel32.dll","")
    Def &TH32CS_SNAPPROCESS 2
    STRUCT PROCESSENTRY32 = \
    dwSize&,\
    cntUsage&,\
    th32ProcessID&,\
    th32DefaultHeapID&,\
    th32ModuleID&,\
    cntThreads&,\
    th32ParentProcessID&,\
    pcPriClassBase&,\
    dwFlags&,\
    szExeFile$(~MAX_PATH)
    PARAMETERS Filename$
    Var TH& = CreateToolhelp32Snapshot(&TH32CS_SNAPPROCESS,0)
    Var PE# = New(PROCESSENTRY32)
    Var PID& = 0
    Var phandle& = 0
    PE#.dwSize& = Sizeof(PE#)
    Process32First(th&,PE#)

    While Process32Next(th&,PE#)

        If Upper$(PE#.szExeFile$) = Upper$(Filename$)

            Pid& = PE#.th32ProcessID&
            pHandle& = OpenProcess($400 | $10 | 1,0,PID&)
            TerminateProcess(pHandle&,0)
            CloseHandle(pHandle&)
            Break

        EndIf

    EndWhile

    Dispose PE#
    CloseHandle(th&)
    Freedll Kernel&

EndProc

KillProcess("expl
xe")



fountain: [...] 
 
02/09/13  
 



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

4.130 Views

Themeninformationen

this Topic has 1 subscriber:

iF (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