import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
import com.sun.jna.WString; public class Program { public interface user32 extends Library
{
public int MessageBoxW(int something, WString text, WString caption, int flags);
} public static void main(String[] args) {
@SuppressWarnings("deprecation")
user32 lib = (user32) Native.loadLibrary("user32", user32.class);
lib.MessageBoxW(, new WString("MessageBox success!"), new WString("Attention"), );
System.out.println("end");
}
}

需引入:jna-5.4.0.jar和jna-platform-5.4.0.jar

05-11 22:32