网站首页  词典首页

请输入您要查询的函数:

 

术语 enumprocesses
释义 EnumProcesses
语法:
C++
BOOL WINAPI EnumProcesses(
__out DWORD *pProcessIds,
__in DWORD cb,
__out DWORD *pBytesReturned
);
EnumProcesses函数
检索每个进程中的系统对象的进程标识符。
参数
pProcessIds [out]
甲到一个数组,它接收的进程标识符列表指针。
文件 [in]
该pProcessIds数组的大小,以字节为单位。
pBytesReturned [out]
在该pProcessIds数组返回的字节数。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
这是一个好主意,用一个大数组,因为这是很难预测有多少进程会在调用EnumProcesses时间。
为了确定有多少过程进行了列举,除以sizeof(DWORD值)的pBytesReturned价值。没有给出时,缓冲区太小,存储所有进程标识符的迹象。因此,如果pBytesReturned等于文件,考虑试一个更大的数组的呼吁。
要获取进程标识符为那些您刚才工艺得到处理,调用OpenProcess函数。
与PSAPI版本的Windows 7和Windows Server 2008 R2的2起,这个功能被定义为Psapi.h K32EnumProcesses和Kernel32.lib和Kernel32.dll出口。但是,您应该马上为EnumProcesses这个函数。为了确保对程序将运行在Windows的早期版本的符号的正确决议,添加Psapi.lib到TARGETLIBS宏和编译程序与- DPSAPI_VERSION = 1。
实例
有关示例,请参见枚举枚举所有进程,或者一个进程的所有模块。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderPsapi.h
LibraryKernel32.lib在Windows 7和Windows Server 2008 R2的Psapi.lib在Windows Server 2008,Windows Vista中的Windows Server 2003,和Windows XP/2000
DLLKernel32.dll在Windows 7和Windows Server 2008 R2的Psapi.dll在Windows Server 2008,Windows Vista中的Windows Server 2003,和Windows XP/2000
参见
CreateToolhelp32Snapshot
OpenProcess
工艺信息
PSAPI函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==EnumProcesses Function
Retrieves the process identifier for each process object in the system.
Syntax
C++
BOOL WINAPI EnumProcesses(
__out DWORD *pProcessIds,
__in DWORD cb,
__out DWORD *pBytesReturned
);
Parameters
pProcessIds [out]
A pointer to an array that receives the list of process identifiers.
cb [in]
The size of the pProcessIds array, in bytes.
pBytesReturned [out]
The number of bytes returned in the pProcessIds array.
Return Value
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 .
Remarks
It is a good idea to use a large array, because it is hard to predict how many processes there will be at the time you call EnumProcesses.
To determine how many processes were enumerated, divide the pBytesReturned value by sizeof(DWORD). There is no indication given when the buffer is too small to store all process identifiers. Therefore, if pBytesReturned equals cb, consider retrying the call with a larger array.
To obtain process handles for the processes whose identifiers you have just obtained, call the OpenProcess function.
Starting with PSAPI version 2 for Windows 7 and Windows Server 2008 R2, this function is defined as K32EnumProcesses in Psapi.h and exported in Kernel32.lib and Kernel32.dll. However, you should always call this function as EnumProcesses. To ensure correct resolution of symbols for programs that will run on earlier versions of Windows, add Psapi.lib to the TARGETLIBS macro and compile the program with –DPSAPI_VERSION=1.
Examples
For an example, see Enumerating All Processes or Enumerating All Modules for a Process .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderPsapi.h
LibraryKernel32.lib on Windows 7 and Windows Server 2008 R2, Psapi.lib on Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000
DLLKernel32.dll on Windows 7 and Windows Server 2008 R2, Psapi.dll on Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000
See Also
CreateToolhelp32Snapshot
OpenProcess
Process Information
PSAPI Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms682629(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2025/1/9 3:44:15