A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



GetConsoleProcessList

The GetConsoleProcessList function retrieves a list of the processes attached to the current console.

VB4-32,5,6
Declare Function GetConsoleProcessList Lib "kernel32" (lpdwProcessList As Long, ByVal dwProcessCount As Long) As Long

Operating Systems Supported
Requires Windows XP or later; Win9x/ME: Not supported

Library
Kernel32

Parameter Information
- lpdwProcessList
[out] Pointer to a buffer that receives an array of process identifiers.

- dwProcessCount
[in] Maximum number of process identifiers that can be stored in the lpdwProcessList buffer.

Return Values
The return value is the number of processes that are attached to the current console.

If the return value is less than or equal to dwProcessCount, it is also the number of process identifiers stored in the lpdwProcessList buffer.

If the return value is greater than dwProcessCount, the lpdwProcessList buffer is too small to hold all the valid process identifiers. The function will have stored no identifiers in the buffer. In this situation, use the return value to allocate a buffer that is large enough to store the entire list, and call the function again.

If the return value is zero, the function has failed, because every console has at least one process associated with it. To get extended error information, call GetLastError.

Last update: 07 April 2006