如何在 Win 2003 上从 VB 6 枚举进程? [英] How To Enumerate Processes From VB 6 on Win 2003?

查看:39
本文介绍了如何在 Win 2003 上从 VB 6 枚举进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些旧的 VB6 代码部分,其中通过调用 CreateToolhelpSnapshot 枚举机器上正在运行的进程.我正在尝试在 Win 2003 R2 上运行此代码,我有理由对它返回的进程列表有点怀疑.我发现 这篇文章 这让我觉得我可能需要使用不同的2003 年的 API 调用.但是我找不到他提到的 Microsoft 知识库文章.或者反正我也找不到英文版.我确实找到了德语文章,但我看不懂德语.我认为它建议我使用名为 EnumProcs 的 API,但我在 Microsoft API 文档中找不到任何此类 API(至少在 msdn.microsoft.com 上没有).

I've got some old VB6 code part of which enumerates the running processes on the machine via a call to CreateToolhelpSnapshot. I'm attempting to run this code on Win 2003 R2 and I have reason to be a little suspicious of the list of processes that it's returning. I found this article which leads me to think I might need to use a different API call on 2003. However I cannot find the Microsoft KnowledgeBase article that he mentions. Or I can't find the English version anyway. I did find the article in German but I can't read German. I think it's advising me to use an API called EnumProcs but I don't find any such API in the Microsoft API docs (at least not at msdn.microsoft.com).

那么,我应该在 Win 2003 上使用 CreateToolhelpSnapshot 还是应该使用其他一些 API?有谁知道我在哪里可以找到那篇英语知识库文章的副本?

So, should I be using CreateToolhelpSnapshot on Win 2003 or is there some other API which I should use? And does anyone have any idea where I might find a copy of that KB article in English?

推荐答案

这个 文章 非常全面地列出了如何做您需要的事情.它基本上使用 EnumProcesses Windows API 调用而不是 GetActiveProcesses 调用.

This article gives quite a comprehensive listing of how to do what you need. It basically uses the EnumProcesses Windows API call instead of the GetActiveProcesses one.

请注意,不仅是 Windows Server 2003,还包括 NT 系列的所有 Windows 版本(XP、Vista 等).

Note that it's not just Windows Server 2003, but all the Windows versions of the NT family (XP, Vista, etc.) too.

这篇关于如何在 Win 2003 上从 VB 6 枚举进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆