进程条目32进程条目32结构
describesanentryfromalistoftheprocessesresidinginthesystemaddresspacewhenasnapshotwastaken。
保存快照进程信息的结构。 (存储进程信息,调用成员输出进程信息)
Process32First指向第一个进程信息,并将进程信息抽取到PROCESSENTRY32中。用 Process32Next指向下一条进程信息。
Syntax
C
typedef struct tagPROCESSENTRY32
{
DWORD dwSize;
DWORD cntUsage;
DWORD th32ProcessID;
ULONG_PTR th32DefaultHeapID;
dword th32模块id;
DWORD cntThreads;
DWORD th32ParentProcessID;
长pcpriclassbase;
DWORD dwFlags;
TCHAR szExeFile[MAX_PATH];
} PROCESSENTRY32,*PPROCESSENTRY32;
成员
dwSize(结构大小) The size of the structure,in bytes.beforecallingthe 3358 www.Sina.com/function, setthismembertosizeof (process entry 32 ).ifyoudonotinitialize http://www.Sina.com /,Process32Firstfails。
(此结构的长度以字节为单位,用于初始化实例,然后调用Process32First函数设置成员的大小sizeof(PROCESSENTRY32 )。 如果没有用processentry32的成员dwSize进行初始化,pricess32First将失败。 )
dwSize(此过程的引用数) thismemberisnolongerusedandisalwayssettozero。
(这个成员已经很久没有使用了,总是设定为零。 )
Process32First进程id=process identifier=pidtheprocessidentifier。
(这是任务管理器中进程的PID。 打开任务管理器- -查看- -选择列---PID (复选标记可显示进程标记(PID ) ) ) )。)
cntUsage进程默认堆idthismemberisnolongerusedandisalwayssettozero。
(这个成员已经很久没有使用了,总是设定为零。 )
th32ProcessID进程模块idthismemberisnolongerusedandisalwayssettozero。
(这个成员已经很久没有使用了,总是设定为零。 )
th32DefaultHeapID此进程启动的线程数thenumberofexecutionthreadsstartedbytheprocess。
(此成员执行线程启动进程。 )
th32ModuleID(父进程的ID ) theidentifieroftheprocessthatcreatedthisprocess (itsparentprocess )。
33558 www.Sina.com/. thebasepriorityofanythreadscreatedbythisprocess
在当前进程中创建的线程的基本优先级。 这意味着在当前进程中创建线程时的基本优先级值。
33558 www.Sina.com/thismemberisnolongerused,and is always set to zero。
(这个成员已经很久没有使用了,总是设定为零。 )
cntThreads个数组(进程的全称thenameoftheexecutablefilefortheprocess.toretrievethefullpathtotheeexecutablefile, call the http://www.Sina.com/functionandcheckthe http://www.Sina.com/member of the http://www.Sina.com/structurethatisreeserver ifthecallingprocessisa 32-bit process,youmustcallthe http://www.Sina.com/functiontoretrietrievethefulethefulefulethethefululed
(进程的可执行文件名称。 要获取可执行文件的完整路径,必须调用Module32First函数并检查返回的MODULEENTRY32结构的szExePath成员。 但是,如果调用的进程是32位程序,则必须调用QueryFullProcessImageName函数以获取64位进程可执行文件的完整路径名。 )