SWT Win32 extension is a Native WIN32 extension of the eclipse class library SWT.
This project provides a software development tool library that allows you to use Java to develop Native Windows applications without writing additional JNI code.
With SWT Win32 extension, you do not need to create a native dynamic link library to call the system API or method of the dynamic link library of the operating system.
You only need to write Java code, and SWT Win32 extension is responsible for the rest.
SWT Win32 extension provides a series of functions that make your application look like a Win32 local program.
- Window decoration function: Provides window top, transparency, flashing, and other functions.
- Custom window: Create an irregular window.
- Access the Windows registry.
- System Folder: Get the path and icon of the system special file.
- System shortcut: Management System shortcut.
- System Information: collect information about the CPU, memory, and environment variables of the system.
- System session: provides functions such as shutdown, sleep, restart, and logout.
- System Io and network functions: provides disk and network information.
- Active Desktop: Manage Windows Active Desktop.
- System HOOK: registers and unmounts system hooks to intercept and process system events.
- Window System Menu: Manage Window menu.
- You can customize system menus and process menu events.
- OLE Control: Provides encapsulation of some common controls, such as flash.
It is worth mentioning that you can access all the functions provided by SWT, because SWT Win32 extension is derived from SWT.
Example code:
Java code
- Import org. SF. Feeling. SWT. win32.internal. extension. extension;
- Public class systeminfo {
- /**
- * @ Param ARGs
- */
- Public static void main (string [] ARGs ){
- Extension extension = new extension ();
- System. Out. println ("computer name:" + extension. getcomputername ());
- System. Out. println ("system Logon account:" + extension. GetUserName ());
- System. Out. println ("system CPU No.:" + extension. getcpuid ());
- System. Out. println ("system Mac No.:" + extension. getmacid ());
- }
- }
Note that to make the program run smoothly, java_home/bin must be imported to the swt-extension-win32.dll file, since the file is downloaded there are three DLL files, there are two swt-gdip-win32.dll and swt-win32.dll, if you import all of them into the results, this exception will be thrown.
Exception in thread "Main" Java. Lang. unsatisfiedlinkerror: org. Eclipse. SWT. Internal. C. ptr_sizeof () I
At org. Eclipse. SWT. Internal. C. ptr_sizeof (native method)
At org. Eclipse. SWT. Internal. C. <clinit> (C. Java: 24)
At com. hengte. example. systeminfo. Main (systeminfo. Java: 10)
This exception occurs because the DLL file cannot be found or multiple DLL file conflicts, remove other DLL files as long as the import swt-extension-win32.dll, run, this is the result of the console printing:
Name: XP-200901051818
System Logon account: Administrator
System CPU No.: BFEBFBFF00010676-0000000000000000
System Mac No.: [I @ 3 ecfff
Project address:Http://feeling.sourceforge.net /? Language = ZH-CN
Eclipse plug-in Update site URL: http://feeling.sourceforge.net/update
Download
SWT Win32 extension (build v2008.12.04)
Download
SWT Win32 extension example plug-in (eclipse 3.2 or later)
Download
SWT Win32 extension local sample program (exe program, no need to install JRE)