Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to know which are the application are running presently

 
varun seth
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everybody
i have a doubt related to core JAVA programming. I need a Core JAVA program which gives the all the presently running application on the system, which we usally get by clicking the (alt+ctrl+delete) simultaniously. Over there we get that which application is runnig and which is not responding.

So through Core JAVA program i want to know list of application are ruuning successfully and which are not responding.

Please give the reply as soon as possible.
Thanks!
Varun Seth
 
Henry Wong
author
Sheriff
Posts: 22542
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently, I don't think there is an API that will directly return what you are seeking. However, you can call a windows program for it....

If you have Windows XP professional, you can call the "tasklist" command, via Runtime.exec(), and parse the results. I believe that "Running/Not Responding" is actually one of the fields.

For Win2k, Win2k3, there are various tools, but I don't think any are built in. You may have to download the tool from the Microsoft site. I have seen "tlist", "plist", and "pslist" tools. Although at the moment, I don't recall which program comes from which package.

Henry
 
varun seth
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya Henry

i am stisfied with you. but i think that with the help of Native Code this problen can be solveld very easily....

can any body give native code for that purpose.

please do it as soon as possible.

tahnks!
 
Henry Wong
author
Sheriff
Posts: 22542
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Runtime.exec() is probably something that you will need many times in your career -- it should be something that you have in your arsenal. Take a look at this article for a good discussion, along with many examples.

As for tasklist, you can refer to the Microsoft site for its usage.

Henry
 
varun seth
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks hanary

by these method we get only that some application are running...
but i am unable to get that which java application is running....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!