Windows API 将显示正在运行的进程
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4593493/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Windows API's which will show the running processes
提问by user562495
I want to create a tool like mini task manager. I want to show all the running processes, cpu and memory usage. Can anybody tell me related api's which I can use for this. Any link to related web page will be appreciated. (I want dump of all the statistics of running processes, cpu and memory.) Thanks in advance.
我想创建一个像迷你任务管理器这样的工具。我想显示所有正在运行的进程、cpu 和内存使用情况。谁能告诉我相关的 api 可以用于此目的。任何相关网页的链接将不胜感激。(我想转储正在运行的进程、cpu 和内存的所有统计信息。)在此先感谢。
采纳答案by Jon
To do that, you will need to use the tool help functions to get snapshotsof the system.
为此,您需要使用工具帮助功能来获取系统快照。
Hereis a code example.
这是一个代码示例。
回答by Vikram.exe
You can use EnumProcess
and openProcess
to do this.
Here is a complete sample code for this: http://msdn.microsoft.com/en-us/library/ms682623%28v=vs.85%29.aspx
您可以使用EnumProcess
和openProcess
来做到这一点。这是一个完整的示例代码:http: //msdn.microsoft.com/en-us/library/ms682623%28v=vs.85%29.aspx