First of all a warning: the code I posted is native C code, and works with Windows only. Mac and Linux have different ways which unfortunately I don't know, and is also determined to the windowing system used. X11 and Xorg may have different calls for this.
Matteo Lanzi wrote:so you mean in java i can use an int pointer to a window? [/url]
HWND is the same size as an int, so yes you can. Just remember to cast it back to HWND in native code.
However, I don't know the size of window handles in Mac or Linux, so you may have to end up with long instead and discard part of it when converting to HWND.
in java with (*env) i can dereference a pointer?
There are no pointers in Java. As I said at the top of this post, the code I posted is C code. With (*env) you can dereference a pointer in C, but not in Java.
of course i have to make dll for win mac and linux, so can embed them in the project and still use an applet? I'd like to use an applet because this application have to works with a flex application
If you use the same class(es) for Windows, Mac and Linux with just different native implementations, there is no problem. Just call System.loadLibrary and it will translate the library for you to a native file. For instance,
searches for mywindows.dll in Windows, and for libmywindows.so in Linux (and probably Mac as well).