Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Listing the running process for an OS...
Listing the running process for an OS... [message #446723] Wed, 01 December 2004 16:33 Go to next message
Tim is currently offline TimFriend
Messages: 18
Registered: July 2009
Junior Member
Is there a way to use SWT (Or in Java in general) to create a list of all
the processes that are runnning? This is a one of program so I only need
it to run under Windows XP.

Essentially I'd like a list similar to that found in the Task Manager.

Does anyone know a way to do this?
Re: Listing the running process for an OS... [message #446734 is a reply to message #446723] Wed, 01 December 2004 22:15 Go to previous messageGo to next message
James Cooper is currently offline James CooperFriend
Messages: 4
Registered: July 2009
Junior Member
Tim wrote:

> Is there a way to use SWT (Or in Java in general) to create a list of all
> the processes that are runnning? This is a one of program so I only need
> it to run under Windows XP.

> Essentially I'd like a list similar to that found in the Task Manager.

> Does anyone know a way to do this?


You'll have to delve in the murky depths of the Windows API and get your
hands dirty with some JNI.
Take a look at [org.eclipse.swt.internal.win32.OS.java] for using native
methods from Java and at [swt.c] for how to write a JNI wrapper. It's not
a hard as it may look (it helps if you know C of course)
Re: Listing the running process for an OS... [message #446735 is a reply to message #446734] Thu, 02 December 2004 00:07 Go to previous messageGo to next message
foo bar is currently offline foo barFriend
Messages: 55
Registered: July 2009
Member
On Wed, 1 Dec 2004 22:15:12 +0000 (UTC), James Cooper
<cooperjames_at@at_eircom.dot.net> wrote:

> Tim wrote:
>
>> Is there a way to use SWT (Or in Java in general) to create a list of
>> all the processes that are runnning? This is a one of program so I only
>> need it to run under Windows XP.
>
>> Essentially I'd like a list similar to that found in the Task Manager.
>
>> Does anyone know a way to do this?
>
>
> You'll have to delve in the murky depths of the Windows API and get your
> hands dirty with some JNI.
> Take a look at [org.eclipse.swt.internal.win32.OS.java] for using native
> methods from Java and at [swt.c] for how to write a JNI wrapper. It's
> not a hard as it may look (it helps if you know C of course)
>

If you're just on XP ( and maybe 2003 Server ) then a quick hack would
be to spawn C:\winxp\system32\tasklist.exe and parse the output.

Course this _is_ a hack and so maybe won't suit your needs...

-- d
Re: Listing the running process for an OS... [message #446747 is a reply to message #446723] Thu, 02 December 2004 10:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kostask.vector.gr

Tim wrote:
> Is there a way to use SWT (Or in Java in general) to create a list of
> all the processes that are runnning? This is a one of program so I only
> need it to run under Windows XP.
>
> Essentially I'd like a list similar to that found in the Task Manager.
>
> Does anyone know a way to do this?
>

Brush up your C++ and JNI skills and take a look at this:

http://www.codeproject.com/threads/processes.asp

Happy coding!
Re: Listing the running process for an OS... [message #446803 is a reply to message #446747] Thu, 02 December 2004 15:24 Go to previous message
Tim is currently offline TimFriend
Messages: 18
Registered: July 2009
Junior Member
Thanks for the replies guys! Much help.

Tim
Previous Topic:Safari Browser
Next Topic:Using PNG with Alpha channel in SWT Widgets
Goto Forum:
  


Current Time: Thu Oct 29 17:51:48 GMT 2020

Powered by FUDForum. Page generated in 0.01326 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top