PROCESSENTRY32

用來存放快照進程信息的一個結構體。(存放進程信息和調用成員輸出進程信息)用來 Process32First指向第一個進程信息,並將進程信息抽取到PROCESSENTRY32中。用Process32Next指向下一條進程信息。

PROCESSENTRY32 Structure
Describes 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;
TCHAR szExeFile[max_path];
} PROCESSENTRY32, *PPROCESSENTRY32;

Members

dwSize(結構的大小)The size of the structure, in bytes. Before calling the Process32Firstfunction, set this member to sizeof(PROCESSENTRY32). If you do not initialize dwSize, Process32Firstfails.
(這個結構的長度,以位元組為單位,初始化一個實例以後調用Process32First函式,設定成員的大小sizeof (PROCESSENTRY32).如果你沒用PROCESSENTRY32中的成員dwSize初始化,pricess32First將會失敗。)
cntUsage(此進程的引用計數)This member is no longer used and is always set to zero.(這個成員已經不再被使用,總是設定為零。)
th32ProcessID進程ID=process identifier=PIDThe process identifier.
(這個就是任務管理器裡面的進程的PID,打開任務管理器--查看---選擇列---PID(勾選)就可以顯示進程的標示符(PID))
th32DefaultHeapID進程默認堆IDThis member is no longer used and is always set to zero.
(這個成員已經很久沒有使用,總是設定為零。)
th32ModuleID進程模組IDThis member is no longer used and is always set to zero.
(這個成員已經很久沒有使用,總是設定為零。)
cntThreads此進程開啟的執行緒計數The number of execution threads started by the process.
(這個成員執行執行緒開始的進程。)
th32ParentProcessID(父進程的ID)The identifier of the process that created this process (its parent process).
pcPriClassBase.(執行緒優先權)The base priority of any threads created by this process
當前進程創建的任何一個執行緒的基礎優先權,即在當前進程內創建執行緒的話,其基本優先權的值。
dwFlagsThis member is no longer used, and is always set to zero.
(這個成員已經很久沒有使用,總是設定為零。)
szExeFile(一個數組)進程全名The name of the executable file for the process. To retrieve the full path to the executable file, call the Module32Firstfunction and check the szExePathmember of the MODULEENTRY32structure that is returned. However, if the calling process is a 32-bit process, you must call the QueryFullProcessImageNamefunction to retrieve the full path of the executable file for a 64-bit process.
(進程的執行檔名稱。要獲得執行檔的完整路徑,應調用Module32First函式,再檢查其返回的MODULEENTRY32結構的szExePath成員。但是,如果被調用進程是一個64位程式,您必須調用QueryFullProcessImageName函式去獲取64位進程的執行檔完整路徑名。)

熱門詞條

聯絡我們