HANDLE WINAPI CreateToolhelp32Snapshot(
DWORD dwFlags,
DWORD th32ProcessID
);dwFlags
Specifies portions of the system to include in the snapshot. This parameter can be one of the following: Value Meaning
TH32CS_INHERIT Indicates that the snapshot handle is to be inheritable.
TH32CS_SNAPALL Equivalent to specifying TH32CS_SNAPHEAPLIST, TH32CS_SNAPMODULE, TH32CS_SNAPPROCESS, and TH32CS_SNAPTHREAD.
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 process list in the snapshot.
TH32CS_SNAPTHREAD Includes the thread list in the snapshot. 像这类函数怎么用(带有固定值的如dwFlag)?dwFlag 的值有:TH32CS_INHERIT,TH32CS_SNAPALL,TH32CS_SNAPHEAPLIST ,TH32CS_SNAPMODULE ,TH32CS_SNAPPROCESS
我在VB中已经定义:
Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
在VC中好象可以这样调用:
hModule=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,pinfo->th32ProcessID)
在VB中怎么用??关键是dwFlags 的这些值怎么才能用?好象这些值TH32CS_INHERIT,TH32CS_SNAPALL VB中都没有定义??
DWORD dwFlags,
DWORD th32ProcessID
);dwFlags
Specifies portions of the system to include in the snapshot. This parameter can be one of the following: Value Meaning
TH32CS_INHERIT Indicates that the snapshot handle is to be inheritable.
TH32CS_SNAPALL Equivalent to specifying TH32CS_SNAPHEAPLIST, TH32CS_SNAPMODULE, TH32CS_SNAPPROCESS, and TH32CS_SNAPTHREAD.
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 process list in the snapshot.
TH32CS_SNAPTHREAD Includes the thread list in the snapshot. 像这类函数怎么用(带有固定值的如dwFlag)?dwFlag 的值有:TH32CS_INHERIT,TH32CS_SNAPALL,TH32CS_SNAPHEAPLIST ,TH32CS_SNAPMODULE ,TH32CS_SNAPPROCESS
我在VB中已经定义:
Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
在VC中好象可以这样调用:
hModule=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,pinfo->th32ProcessID)
在VB中怎么用??关键是dwFlags 的这些值怎么才能用?好象这些值TH32CS_INHERIT,TH32CS_SNAPALL VB中都没有定义??
#define TH32CS_SNAPHEAPLIST 0x00000001
#define TH32CS_SNAPPROCESS 0x00000002
#define TH32CS_SNAPTHREAD 0x00000004
#define TH32CS_SNAPMODULE 0x00000008
#define TH32CS_SNAPALL (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE)
#define TH32CS_INHERIT 0x80000000
能不能这样定义 CONST TH32CS_SNAPPROCESS = 0x00000002,然后就直接用?还是怎么才能用呢?请高手帮一下忙
C/C++中的“#define TH32CS_SNAPPROCESS 0x00000002”语句在VB中应该是“Const TH32CS_SNAPPROCESS =&H00000002”。