I wrote a Java Program to load user32.dll and access the methods in that dll as native methods Please refer following code: public class test{ static { try{ System.loadLibrary("User32"); } catch(Exception e) { e.printStackTrace(); } } public static void main(String args[]) { test t1=new test(); t1.MessageBeep(4); } public native int MessageBoxA(int i,String a,String b,String c,int j); public native int MessageBeep(int i); } I complied above code, it complied with throwing an error, but at runtime I am getting a exception : Exception in thread "main" java.lang.UnsatisfiedLinkError: MessageBeep at test.MessageBeep(Native Method) at test.main(test.java:13) Instead of load Library method, I tried using load(with full path of user32.dll file), in that case also I am getting the same erro. Can any one tell me why I am getting this exception.
Quickly answer: user32.dll is not a JNI compliant dll You will need to create a new dll to wrap de user32.dll so you can load that wrapper.dll in your Java code.
Hello Antonio, Do you have such a wrapper .dll for User32.dll? Or can you tell me how should I make such a wrapper dll? I just want to use BlockInput from this User32.dll. Maybe you can help me with this... Thanks!