How to pass wide strings in Java calling the MessageBoxW function in user32 lib
<p>I am currently struggling to use the function <code>MessageBoxW</code> in Java. I have managed to successfully call the user32 library and use the <code>MessageBoxA</code> function. Here's my code below:</p>

<pre><code>package messagebox;

import com.sun.jna.Library;
import com.sun.jna.Native;

public class MessageBox 
{
    public interface user32 extends Library
    {
        public int MessageBoxA(int something, String text, String caption, int flags);
    }

    public static void main(String[] args) 
    {
        System.out.println("Program starting... Library loading... ");
        user32 lib = (user32) Native.loadLibrary("user32", user32.class);
        System.out.println("Presenting Message Box ...");
        lib.MessageBoxA(0,"MessageBox success!!!","Attention",0);
    }
}
</code></pre>

<p>I've looked around and could not find any conclusive answers but something tells me that I need much more sophisticated coding to tackle this problem. Any help with this would be much appreciated.</p>