通过SWT获取任务管理器列表?

发布于 2024-08-03 17:16:49 字数 214 浏览 2 评论 0原文

有没有办法使用 SWT 获取当前正在运行的所有进程的列表(类似于在 Windows 上执行 tasklist.exe/tlist.exe)?如果是的话,有可用的示例代码吗?

理想情况下,这只能以编程方式完成(没有第三方工具)。

我的应用程序监视进程列表,需要支持 Windows 2000/Server 2003/XP Home/XP Pro/Vista

提前致谢。

Is there a way using SWT to get a list of all processes currently running (similar to executing tasklist.exe/tlist.exe on Windows)? If so, is there sample code available?

Ideally this would be done programmatically only (no third party tools).

My app monitors the process list and needs to support Windows 2000/Server 2003/XP Home/XP Pro/Vista

Thanks in advance.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亢潮 2024-08-10 17:16:49

使用 SWT 似乎不可能做到这一点,甚至 Java 也不适合跨多个平台。我最终使用 JNI 列出正在运行的任务。这适用于我需要的所有操作系统。我在下面的地址找到了一个很好的工作示例,并将其集成到我的应用程序中。实现了多种功能,例如列出进程、终止进程、查找特定 EXE 是否正在运行等等。希望这对将来的人有帮助。

http://www.codeproject.com/KB/java/jnisample.aspx

This does not seem to be possible using SWT or even Java for that matter is a poor fit across multiple platforms. I ended up using JNI to list the running tasks. This works across all OS that I required. I found a good working example at the address below that I integrated into my app. Has multiple features implemented such as listing processes, killing processes, finding if specific EXE is running, and more. Hope this helps someone in the future.

http://www.codeproject.com/KB/java/jnisample.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文