java.lang.Object | +--com.neva.Win32PlatformFunction
| Constructor Summary | |
Win32PlatformFunction()
Creates a Win32PlatformFunction. |
|
Win32PlatformFunction(java.lang.String library,
java.lang.String function)
Creates a Win32PlatformFunction. |
|
| Method Summary | |
static void |
Beep(int freq,
int dura)
Generates simple tones on the speaker. |
static boolean |
CloseHandle(int handle)
Closes an open object handle. |
static int |
CreateEvent(java.lang.String name,
boolean state)
Creates a named or unnamed event object. |
static int |
CreateProcess(java.lang.String commandLine)
Creates a new process. |
static int |
CreateProcess(java.lang.String commandLine,
boolean showWindow)
Creates a new process. |
static int |
CreateProcess(java.lang.String commandLine,
boolean showWindow,
int[] id)
Creates a new process. |
static int[] |
EnumerateWindows()
Answers an array of window handles |
static java.lang.String |
ExpandEnvironmentStrings(java.lang.String in)
Replaces environment-variable strings in in by their values |
static java.lang.String |
GetClipboardText()
Copies text from Clipboard and aswers it. |
static java.lang.String |
GetEnvironmentVariable(java.lang.String env)
Answers the value of the specified variable from the process' environment block. |
static java.lang.String |
GetOSVersion(int[] osver)
Answers extended information about the version of the OS that is currently running. |
static java.lang.String |
GetWindowText(int hwnd)
Answers the specified window's title |
static int |
GetWindowThreadProcessId(int hwnd)
Answers the thread id of the thread that created the specified window |
static int |
MessageBox(int owner,
java.lang.String message,
java.lang.String title,
int style)
Displays modeless message box. |
static int |
OpenEvent(java.lang.String name)
Obtains a handle of an existing named event object. |
static boolean |
Play(java.lang.String path)
Plays WAV file. |
static boolean |
Play(java.lang.String path,
int how)
Plays WAV file. |
static com.neva.ExternalObject |
ReadFile(java.lang.String path)
Opens a file with FILE_SHARE_READ attribute.Reads the file bytes. |
static int |
RegCloseKey(int key)
Closes the handle to the specified registry key. |
static int |
RegCreateKey(int key,
java.lang.String subkey,
java.lang.String clazz,
int accessMask,
int options,
int[] handle)
Creates the specified registry key. |
static int |
RegDeleteKey(int key,
java.lang.String subkey)
Deletes the specified registry key. |
static int |
RegDeleteValue(int key,
java.lang.String valueName)
Removes a named value from the specified registry key. |
static int |
RegOpenKey(int key,
java.lang.String subkey,
int accessMask,
int[] handle)
Opens the specified registry key. |
static byte[] |
RegQueryValue(int key,
java.lang.String valueName,
int[] type)
Retrieves the type and data for a specified value name. |
static int |
RegSetValue(int key,
java.lang.String valueName,
byte[] data)
Stores a byte array in the value field of an open registry key. |
static int |
RegSetValue(int key,
java.lang.String valueName,
byte[] data,
int type)
Stores data in the value field of an open registry key. |
static int |
RegSetValue(int key,
java.lang.String valueName,
int data)
Stores integer data in the value field of an open registry key. |
static int |
RegSetValue(int key,
java.lang.String valueName,
java.lang.String data)
|
static boolean |
SetClipboardText(java.lang.String data)
Copies text to Clipboard. |
static boolean |
SetEvent(int handle)
Sets the state of the specified event object to signaled. |
static int |
Wait(int handle,
int howLong)
Wrapper for Win32 WaitForSingleObject api. |
static boolean |
WriteFile(java.lang.String path,
byte[] data,
int length)
Opens a file exclusively. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Win32PlatformFunction()
public Win32PlatformFunction(java.lang.String library,
java.lang.String function)
| Method Detail |
public static void Beep(int freq,
int dura)
throws java.lang.SecurityException
java.lang.SecurityExceptionpublic static boolean CloseHandle(int handle)
handle - specifies handle to object to close.
public static int CreateEvent(java.lang.String name,
boolean state)
name - specifies the name of the event object. If name is null, the event object is
created without a name.state - specifies the initial state of the event object.
public static int CreateProcess(java.lang.String commandLine)
throws java.lang.SecurityException
commandLine - specifies the command line to execute.
java.lang.SecurityException
public static int CreateProcess(java.lang.String commandLine,
boolean showWindow)
throws java.lang.SecurityException
commandLine - specifies the command line to execute.showWindow - specifies whether to show new process' main window or run it in minimized state.
java.lang.SecurityException
public static int CreateProcess(java.lang.String commandLine,
boolean showWindow,
int[] id)
throws java.lang.SecurityException
commandLine - specifies the command line to execute.showWindow - specifies whether to show new process' main window or run it in minimized state.id - receives identification information about the new process: id[0] - the handle to the newly created
process that can be used to perform operations on the process object; id[1] - the global process identifier that
can be used to identify a process.
java.lang.SecurityException
public static int[] EnumerateWindows()
throws java.lang.SecurityException
java.lang.SecurityExceptionpublic static java.lang.String ExpandEnvironmentStrings(java.lang.String in)
public static java.lang.String GetClipboardText()
throws java.lang.SecurityException
java.lang.SecurityException
public static java.lang.String GetEnvironmentVariable(java.lang.String env)
throws java.lang.SecurityException
env - specifies the environment variable.
java.lang.SecurityException
public static java.lang.String GetOSVersion(int[] osver)
throws java.lang.SecurityException
osver - is used to return four integer that identify the major version number , the
minor version number, the build number, the OS platform id
java.lang.SecurityException
public static java.lang.String GetWindowText(int hwnd)
throws java.lang.SecurityException
hwnd - specifies native window handle
java.lang.SecurityException
public static int GetWindowThreadProcessId(int hwnd)
throws java.lang.SecurityException
java.lang.SecurityException
public static int MessageBox(int owner,
java.lang.String message,
java.lang.String title,
int style)
throws java.lang.SecurityException
message - specifies the message to be displayed.title - specifies the message box title.style - specifies the message box styles.owner - specifies the window handle of the window that owns the message box. Owner set to zero
creates modeless dialog.
java.lang.SecurityExceptionpublic static int OpenEvent(java.lang.String name)
public static boolean Play(java.lang.String path)
throws java.lang.SecurityException
path - specifies file's path name.
java.lang.SecurityException
public static boolean Play(java.lang.String path,
int how)
throws java.lang.SecurityException
path - specifies file's path name.how - specifies flags for playing the sound
java.lang.SecurityException
public static com.neva.ExternalObject ReadFile(java.lang.String path)
throws java.lang.SecurityException
path - specifies the name of the file.
java.lang.SecurityException
public static int RegCloseKey(int key)
throws java.lang.SecurityException
java.lang.SecurityException
public static int RegCreateKey(int key,
java.lang.String subkey,
java.lang.String clazz,
int accessMask,
int options,
int[] handle)
throws java.lang.SecurityException
key - specifies a currently open key or any of the HKEY_* constants.subkey - specifies the name of the subkey to create/open.clazz - specifies the class of this key.accessMask - specifies the desired security access for the key - a combination of the KEY_ACCESS_* constants.options - specifies special options for the key (see REG_OPTION_* constants).handle - is an int array of two elements. On return, the first element contains the key handle and the second element contains
REG_CREATED_NEW_KEY or REG_OPENED_EXISTING_KEY.
java.lang.SecurityException
public static int RegDeleteKey(int key,
java.lang.String subkey)
throws java.lang.SecurityException
key - specifies a currently open key or any of the HKEY_* constants.subkey - specifies the name of the subkey to delete.
java.lang.SecurityException
public static int RegDeleteValue(int key,
java.lang.String valueName)
throws java.lang.SecurityException
key - specifies the handle to an opened key.valueName - specifies the name of the value.
java.lang.SecurityException
public static int RegOpenKey(int key,
java.lang.String subkey,
int accessMask,
int[] handle)
throws java.lang.SecurityException
key - specifies a currently open key or any of the HKEY_* constants.subkey - specifies the name of the subkey to open.accessMask - specifies the desired security access for the opened key - a combination of the
KEY_ACCESS_* constants.handle - is an int array. On return, the handle to the opened key is returned in handle[0]
java.lang.SecurityException
public static byte[] RegQueryValue(int key,
java.lang.String valueName,
int[] type)
throws java.lang.SecurityException
key - specifies the handle to an opened key.valueName - specifies the name of the value to query.type - receives the data type(REG_SZ, REG_EXPAND_SZ, REG_BINARY,REG_DWORD, REG_MULTI_SZ).
java.lang.SecurityException
public static int RegSetValue(int key,
java.lang.String valueName,
byte[] data)
throws java.lang.SecurityException
key - specifies the handle to an opened key.valueName - specifies the name of the value.data - specifies a byte array to store.
java.lang.SecurityException
public static int RegSetValue(int key,
java.lang.String valueName,
byte[] data,
int type)
throws java.lang.SecurityException
key - specifies the handle to an opened key.valueName - specifies the name of the value.data - specifies data to store.type - specifies data type (REG_SZ, REG_EXPAND_SZ, REG_BINARY, REG_DWORD, REG_MULTI_SZ).
java.lang.SecurityException
public static int RegSetValue(int key,
java.lang.String valueName,
int data)
throws java.lang.SecurityException
key - specifies the handle to an opened key.valueName - specifies the name of the value.data - specifies a 32-bit integer to store.
java.lang.SecurityException
public static int RegSetValue(int key,
java.lang.String valueName,
java.lang.String data)
throws java.lang.SecurityException
java.lang.SecurityException
public static boolean SetClipboardText(java.lang.String data)
throws java.lang.SecurityException
java.lang.SecurityExceptionpublic static boolean SetEvent(int handle)
handle - specifies the event object.
public static int Wait(int handle,
int howLong)
throws java.lang.SecurityException
handle - specifies the kernel object (for example, the process handle).howLong - specifies the time-out interval, in milliseconds. If howLong is -1, the time-out interval never elapses.
java.lang.SecurityException
public static boolean WriteFile(java.lang.String path,
byte[] data,
int length)
throws java.lang.SecurityException
length - specifies how many bytes to write.
java.lang.SecurityException