Windows 中通过文件路径获取进程句柄

发布于 2025-01-19 12:38:26 字数 139 浏览 3 评论 0原文

我正在尝试从 Windows 中的 C 中的 exe 文件路径获取进程句柄,不幸的是我在网上找不到太多相关信息。我尝试过使用 OpenProcess 函数,但这需要更多信息而不仅仅是文件路径。是否可以获取所有正在运行的进程的列表并比较它们的文件路径以获得进程句柄?

I am trying to get a process handle from an exe's filepath in C in Windows, I cannot find much online about this unfortunately. I have tried using the OpenProcess function, however this requires more information than just a filepath. Is it possible to get a list of all the running processes and compare their filepaths to obtain the process handle?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文