简体   繁体   English

访问windows 10任务管理器进程列表

[英]Accessing windows 10 task manager process list

When it comes to the Windows 7 task manager, I was easily able to get the process count, etc because the processes were stored in a traditional listview control that I could access using SendMessage functions.当谈到 Windows 7 任务管理器时,我很容易获得进程计数等,因为进程存储在我可以使用 SendMessage 函数访问的传统列表视图控件中。 For explorer/win10 task mgr/etc however the list control that the processes are stored in does not seem to be a traditional control and seems to be a custom control.对于explorer/win10 task mgr/etc 然而,存储进程的列表控件似乎不是传统控件,而是自定义控件。 I was wondering if there is any documentation on the custom controls that Microsoft uses in their newer system applications, and/or if I can access them using SendMessage or something of the sort like I did before?我想知道是否有任何关于 Microsoft 在其较新的系统应用程序中使用的自定义控件的文档,和/或我是否可以使用 SendMessage 或类似我以前使用过的东西访问它们?

 //Get the handle of the list..you can find the handle in win7&10 pretty easily
 FindWindowExA(...parent,IntPtr.Zero,"SysListView32","Processes");//=listview handle
 
 //Sending a message to get the number of processes for instance, works in windows 7 only
 SendMessageA(process list handle,(IntPtr)0x1004,IntPtr.Zero,null);//=process count

If not, is it worth to try to debug my self how to access the list, or is that a bad idea?如果没有,是否值得尝试自我调试如何访问列表,或者这是一个坏主意? Why?为什么? I have a c# application and have no problem porting C++ methods with PInvoke.我有一个 c# 应用程序,使用 PInvoke 移植 C++ 方法没有问题。 Thanks谢谢

Don't do that.不要那样做。 Task Manager isn't doing any magic.任务管理器没有做任何魔术。 It uses Windows APIs to get the list of processes, enumerate it, and obtain details.它使用 Windows API 获取进程列表,枚举它并获取详细信息。 What you're doing is actually harder to get right than simply replicating what Task Manager is doing internally.你正在做的事情实际上比简单地复制任务管理器在内部所做的事情更难做对。 A good starting point would be the Process Status API (psapi) , and there are other APIs that will allow to get resource usage information etc. All it takes to figure out is a "stroll" through WINAPI documentation (admittedly sparse here and there). Process Status API (psapi)是一个很好的起点,还有其他 API 可以获取资源使用信息等。只需“漫步” WINAPI 文档(无可否认,这里和那里都是稀疏的) . If in doubt, use a debugger to break the task manager and see what API calls it makes, or use depends tool to see what APIs it uses so that you'd get an idea where to look.如果有疑问,请使用调试器来破坏任务管理器并查看 API 调用的内容,或者使用depends工具查看它使用的 API,以便您了解在哪里查看。 You can also use reverse-engineering tools like IDA-Pro to do partial disassembly and look for API calls.您还可以使用 IDA-Pro 等逆向工程工具进行部分反汇编并查找 API 调用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从“ Windows任务管理器”进程列表中获取项目c# - Get items from “Windows Task Manager” process list c# C#Winform关闭程序后,该过程仍在Windows任务列表管理器上 - C# Winform The process still on Windows Task list manager after close programme 禁用Windows任务管理器,因此他无法终止我的进程 - Disable Windows Task Manager so he cant kill my process 像任务管理器(Windows 8)一样杀死进程,因为访问被拒绝 - Kill Process like Task Manager (Windows 8) do, because of access denied 扩展任务管理器Windows 8 - Extending Task Manager Windows 8 Winform应用程序名称在Windows 10的“任务管理器”的“启动”选项卡上显示为_alphanumeric - Winform app name shown as _alphanumeric on Startup tab in Task Manager in windows 10 Windows中的任务管理器:“内存”选项卡 - Task Manager in Windows : Memory Tab 为什么 Process.PrivateMemorySize64 /1024 与 Windows Task Manager Memory (Private Working Set) 不匹配? - Why does Process.PrivateMemorySize64 /1024 not match what Windows Task Manager Memory (Private Working Set)? 在C#应用程序中,Windows在任务管理器中显示进程的名称时获取进程的名称? - In a C# application, where does Windows grab the name of process when it appears in the Task Manager? WIX XML中的哪个元素设置Windows任务管理器中显示的进程的描述字段? - What element in WIX XML sets the description field of the process shown in the Windows Task Manager?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM