PROCESSENTRY32 structure

Describes an entry from a list of the processes residing in the system address space when a snapshot was taken.

Syntax

typedef struct tagPROCESSENTRY32 {
  DWORD     dwSize;
  DWORD     cntUsage;
  DWORD     th32ProcessID;
  ULONG_PTR th32DefaultHeapID;
  DWORD     th32ModuleID;
  DWORD     cntThreads;
  DWORD     th32ParentProcessID;
  LONG      pcPriClassBase;
  DWORD     dwFlags;
  CHAR      szExeFile[MAX_PATH];
} PROCESSENTRY32;

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. To retrieve the full path to the executable file, call the Module32First function and check the szExePath member of the MODULEENTRY32 structure that is returned. However, if the calling process is a 32-bit process, you must call the QueryFullProcessImageName function to retrieve the full path of the executable file for a 64-bit process.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header tlhelp32.h

See Also

Process32First

Process32Next