Get task manager list via SWT?

点点圈 提交于 2019-12-13 03:37:04

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/1347732/get-task-manager-list-via-swt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!