Top Description Constructors Methods
com.sun.jna.platform.win32

public abstract Class PsapiUtil

extends Object
Class Inheritance
Imports
com.sun.jna.Native, java.util.Arrays, com.sun.jna.platform.win32.WinDef.DWORD, .WinNT.HANDLE, com.sun.jna.ptr.IntByReference

Psapi utility API.
Author
Torbjörn Svensson, azoff[at]svenskalinuxforeningen.se

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int[]

Returns:

Array of pids
enumProcesses
()

Retrieves the process identifier for each process object in the system.

public static String

Returns:

ame of the executable file for the specified process.
GetProcessImageFileName
(WinNT.HANDLE
A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right. For more information, see Process Security and Access Rights.
Windows Server 2003 and Windows XP: The handle must have the PROCESS_QUERY_INFORMATION access right.
hProcess
)

Retrieves the name of the executable file for the specified process.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PsapiUtilback to summary
public PsapiUtil()

Method Detail

enumProcessesback to summary
public static int[] enumProcesses()

Retrieves the process identifier for each process object in the system.

Returns:int[]

Array of pids

GetProcessImageFileNameback to summary
public static String GetProcessImageFileName(WinNT.HANDLE hProcess)

Retrieves the name of the executable file for the specified process.

Parameters
hProcess:WinNT.HANDLE

A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right. For more information, see Process Security and Access Rights.
Windows Server 2003 and Windows XP: The handle must have the PROCESS_QUERY_INFORMATION access right.

Returns:String

ame of the executable file for the specified process.

Exceptions
Win32Exception:
in case an error occurs
See Also
MSDN