public abstract class Kernel32Util extends Object implements WinDef
WinDef.DWORD, WinDef.DWORDLONG, WinDef.HBITMAP, WinDef.HCURSOR, WinDef.HDC, WinDef.HFONT, WinDef.HICON, WinDef.HINSTANCE, WinDef.HMENU, WinDef.HMODULE, WinDef.HPALETTE, WinDef.HPEN, WinDef.HRGN, WinDef.HRSRC, WinDef.HWND, WinDef.INT_PTR, WinDef.LONG, WinDef.LPARAM, WinDef.LRESULT, WinDef.RECT, WinDef.UINT_PTR, WinDef.ULONG, WinDef.ULONGLONG, WinDef.WORD, WinDef.WPARAM
StdCallLibrary.StdCallCallback
Library.Handler
FUNCTION_MAPPER, STDCALL_CONVENTION
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER
Constructor and Description |
---|
Kernel32Util() |
Modifier and Type | Method and Description |
---|---|
static void |
deleteFile(String filename) |
static String |
formatMessageFromHR(WinNT.HRESULT code)
Format a message from an HRESULT.
|
static String |
formatMessageFromLastErrorCode(int code)
Format a system message from an error code.
|
static String |
getComputerName()
Get current computer NetBIOS name.
|
static int |
getDriveType(String rootName) |
static String |
getEnvironmentVariable(String name)
Get the value of an environment variable.
|
static int |
getFileAttributes(String fileName)
Retrieves file system attributes for a specified file or directory.
|
static int |
getFileType(String fileName)
Retrieves the result of GetFileType, provided the file exists.
|
static String[] |
getLogicalDriveStrings()
Returns valid drives in the system.
|
static String |
getTempPath()
Return the path designated for temporary files.
|
public static String getComputerName()
public static String formatMessageFromHR(WinNT.HRESULT code)
code
- HRESULTpublic static String formatMessageFromLastErrorCode(int code)
code
- Error code, typically a result of GetLastError.public static String getTempPath()
public static void deleteFile(String filename)
public static String[] getLogicalDriveStrings()
public static int getFileAttributes(String fileName)
fileName
- The name of the file or directory.public static int getFileType(String fileName) throws FileNotFoundException
FileNotFoundException
public static int getDriveType(String rootName)