用來(lái)存放快照進(jìn)程信息的一個(gè)結(jié)構(gòu)體。(存放進(jìn)程信息和調(diào)用成員輸出進(jìn)程信息)用來(lái) Process32First指向第一個(gè)進(jìn)程信息,并將進(jìn)程信息抽取到PROCESSENTRY32中。用Process32Next指向下一條進(jìn)程信息。
PROCESSENTRY32 StructureDescribes an entry from a list of the processes residing in the system address space when a snapshot was taken.Syntax
引用所需包含的頭文件:#include"tlhelp32.h"
C++
typedef struct tagPROCESSENTRY32
{
DWORD dwSize;
DWORD cntUsage;
DWORD th32ProcessID;
ULONG_PTR th32DefaultHeapID;
DWORD th32ModuleID;
DWORD cntThreads;
DWORD th32ParentProcessID;
LONG pcPriClassBase;
DWORD dwFlags;
TCHARszExeFile[max_path];
} PROCESSENTRY32, *PPROCESSENTRY32;
dwSize(結(jié)構(gòu)的大?。㏕he size of the structure, in bytes. Before calling theProcess32Firstfunction, set this member to sizeof(PROCESSENTRY32). If you do not initializedwSize,Process32Firstfails.
(這個(gè)結(jié)構(gòu)的長(zhǎng)度,以字節(jié)為單位,初始化一個(gè)實(shí)例以后調(diào)用Process32First函數(shù),設(shè)置成員的大小sizeof (PROCESSENTRY32).如果你沒(méi)用PROCESSENTRY32中的成員dwSize初始化,pricess32First將會(huì)失敗。)
cntUsage(此進(jìn)程的引用計(jì)數(shù))This member is no longer used and is always set to zero.(這個(gè)成員已經(jīng)不再被使用,總是設(shè)置為零。)
th32ProcessID進(jìn)程ID=process identifier=PIDThe process identifier.
(這個(gè)就是任務(wù)管理器里面的進(jìn)程的PID,打開(kāi)任務(wù)管理器--查看---選擇列---PID(勾選)就可以顯示進(jìn)程的標(biāo)示符(PID))
th32DefaultHeapID進(jìn)程默認(rèn)堆IDThis member is no longer used and is always set to zero.
(這個(gè)成員已經(jīng)很久沒(méi)有使用,總是設(shè)置為零。)
th32ModuleID進(jìn)程模塊IDThis member is no longer used and is always set to zero.
(這個(gè)成員已經(jīng)很久沒(méi)有使用,總是設(shè)置為零。)
cntThreads此進(jìn)程開(kāi)啟的線程計(jì)數(shù)The number of execution threads started by the process.
(這個(gè)成員執(zhí)行線程開(kāi)始的進(jìn)程。)
th32ParentProcessID(父進(jìn)程的ID)The identifier of the process that created this process (its parent process).
pcPriClassBase.(線程優(yōu)先權(quán))The base priority of any threads created by this process
當(dāng)前進(jìn)程創(chuàng)建的任何一個(gè)線程的基礎(chǔ)優(yōu)先級(jí),即在當(dāng)前進(jìn)程內(nèi)創(chuàng)建線程的話,其基本優(yōu)先級(jí)的值。
dwFlagsThis member is no longer used, and is always set to zero.
(這個(gè)成員已經(jīng)很久沒(méi)有使用,總是設(shè)置為零。)
szExeFile(一個(gè)數(shù)組)進(jìn)程全名The name of the executable file for the process. To retrieve the full path to the executable file, call theModule32Firstfunction and check theszExePathmember of theMODULEENTRY32structure that is returned. However, if the calling process is a 32-bit process, you must call theQueryFullProcessImageNamefunction to retrieve the full path of the executable file for a 64-bit process.
(進(jìn)程的可執(zhí)行文件名稱。要獲得可執(zhí)行文件的完整路徑,應(yīng)調(diào)用Module32First函數(shù),再檢查其返回的MODULEENTRY32結(jié)構(gòu)的szExePath成員。但是,如果被調(diào)用進(jìn)程是一個(gè)64位程序,您必須調(diào)用QueryFullProcessImageName函數(shù)去獲取64位進(jìn)程的可執(zhí)行文件完整路徑名。)

愛(ài)華網(wǎng)本文地址 » http://www.klfzs.com/a/8104070103/169713.html
愛(ài)華網(wǎng)



