본문 바로가기

프로그래밍/C/C++

프로세스 리스트 가져오기 - Process32First

반응형


중요한건 PROCESSENTRY32 구조체이며

MSDN에는

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 Process32First function, set this member to sizeof(PROCESSENTRY32). If you do not initialize dwSize, Process32First fails.

cntUsage

This member is no longer used and is always set to zero.

th32ProcessID

The process identifier.

th32DefaultHeapID

This member is no longer used and is always set to zero.

th32ModuleID

This member is no longer used and is always set to zero.

cntThreads

The number of execution threads started by the process.

th32ParentProcessID

The identifier of the process that created this process (its parent process).

pcPriClassBase

The base priority of any threads created by this process.

dwFlags

This member is no longer used, and is always set to zero.

szExeFile

The name of the executable file for the process.


PID, PPID, 등등 많은 정보를 가져오는데 

PROCESSENTRY32 의 값만 알아두면 될 것 같다.





반응형