[out] Pointer to an array that receives the list of process identifiers.
[in] Size of the lpidProcess array, in bytes.
[out] Number of bytes returned in the lpidProcess array.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Task Manager is an example of a program that enumerates all running processes. It is implemented using data from the performance registry. The following sample code uses the EnumProcesses function to enumerate the current processes in the system. This method is easier than using the performance registry.