在遍历进程的时候,怎么得到一个进程所用内存的大小?????

foryoume 2003-04-16 12:44:57
在遍历进程的时候,怎么得到一个进程所用内存的大小?????
...全文
85 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunyard 2003-04-16
  • 打赏
  • 举报
回复
GetProcessMemoryInfo
jiadrun 2003-04-16
  • 打赏
  • 举报
回复
GetProcessMemoryInfo
The GetProcessMemoryInfo function retrieves information about the memory usage of the specified process in the PROCESS_MEMORY_COUNTERS structure.

BOOL GetProcessMemoryInfo(
HANDLE Process, // handle to process
PPROCESS_MEMORY_COUNTERS ppsmemCounters, // buffer
DWORD cb // size of buffer
);
Parameters
Process
[in] Handle to the process.
ppsmemCounters
[out] Pointer to the PROCESS_MEMORY_COUNTERS structure that receives information about the memory usage of the process.
cb
[in] Specifies the size, in bytes, of the PROCESS_MEMORY_COUNTERS structure.
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.

Requirements
Windows NT/2000: Requires Windows NT 4.0 or later.
Header: Declared in Psapi.h.
Library: Use Psapi.lib
foryoume 2003-04-16
  • 打赏
  • 举报
回复
GetProcessMemoryInfo
具体怎么写???
它说这个函数没有定义啊,在API中我找不到..
???????????????????

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧