English
Source / code snippets

List Pids processes

 

Frank
Abbing

CompileMarkSeparation
Declare Entry#,err&,handle&,cpid&,text$,text2$
Struct PROCESSENTRY32=dwSize&,
cntUsage&,
th32ProcessID&,
th32DefaultHeapID&,
th32ModuleID&,
Threads&,
th32ParentProcessID&,
pcPriClassBase&,
dwFlags&,
szExeFile$(260)
Dim Entry#,PROCESSENTRY32
Entry#.dwSize& = SizeOf(Entry#)
Def CreateToolhelp32Snapshot(2) !Kernel32, CreateToolhelp32Snapshot
Def Process32First(2) !Kernel32, Process32First
Def Process32Next(2) !Kernel32, Process32Next
Def CloseHandle(1) !Kernel32, CloseHandle
Def GetCurrentProcessID(0) !Kernel32, GetCurrentProcessId

Proc FillProcessList

    cpid&=GetCurrentProcessID()
    handle& = CreateToolhelp32Snapshot(2,0)

    If handle&

        err& = Process32First(handle&, Entry#)

        If err&

            text$=Str$(Entry#.th32ProcessID&)
            text2$=Entry#.szExeFile$
            Print PID: +text$+ | Prozessname: +text2$

            Repeat

                err& = Process32Next(handle&, Entry#)

                If err&

                    text$=Str$(Entry#.th32ProcessID&)
                    text2$=Entry#.szExeFile$
                    Print PID: +text$+ | Prozessname: +text2$

                EndIf

            Until err& = 0

            CloseHandle(handle&)

        EndIf

    EndIf

ENDPROC

 
05/03/07  
 



super code - the has me very helped! for me personally have I from it the following derivational:
CompileMarkSeparation
 
05/25/07  
 




Frank
Abbing
well freut me Yes.
 
05/25/07  
 



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.058 Views

Untitledvor 0 min.
RudiB.08/17/22
AndreasS01/06/19
Klaus Ernst08/25/14
Gary1234506/09/13
More...

Themeninformationen

this Topic has 2 subscriber:

Frank Abbing (2x)
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