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



CreateToolhelp32Snapshot

Takes a snapshot of the processes and the heaps, modules, and threads used by the processes.

VB4-32,5,6
Declare Function CreateToolhelp32Snapshot Lib "Kernel32" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long

VB.NET
System.Diagnostics.Process

Operating Systems Supported
Requires Windows 2000 or later; Requires Windows 95 or later

Library
Kernel32

Parameter Information
- dwFlags
Flags specifying portions of the system to include in the snapshot. These values are defined: TH32CS_INHERIT
Indicates that the snapshot handle is to be inheritable.
TH32CS_SNAPALL
Equivalent to specifying the TH32CS_SNAPHEAPLIST, TH32CS_SNAPMODULE, TH32CS_SNAPPROCESS, and TH32CS_SNAPTHREAD values.
TH32CS_SNAPHEAPLIST
Includes the heap list of the specified process in the snapshot.
TH32CS_SNAPMODULE
Includes the module list of the specified process in the snapshot.
TH32CS_SNAPPROCESS
Includes the Win32 process list in the snapshot.
TH32CS_SNAPTHREAD
Includes the Win32 thread list in the snapshot.

- th32ProcessID
Process identifier. This parameter can be zero to indicate the current process. This parameter is used when the TH32CS_SNAPHEAPLIST or TH32CS_SNAPMODULE value is specified. Otherwise, it is ignored.

Return Values
Returns an open handle to the specified snapshot if successful or - 1 otherwise.

Last update: 07 April 2006