AllAPI Network - The KPD-Team

Allapi Network

 API List

API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
This Site
 Search Engine
 Contact Form

Donate to


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

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


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

[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.


Related Functions



Copyright © 1998-2007, The Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at