In Java 1.4 you could use ((SunToolkit) Toolkit.getDefaultToolkit()).getNativeWindowHandleFromComponent() but that was removed.
It looks like you have to use JNI to do this now. Do you have the JNI code and sample Java code to do this?
I need this to call the Win32 GetWindowLong and SetWindowLong API calls, which can be done via the Jawin library.
I would like something very precise so I can pass a reference to the JDialog or JFrame and get the window handle.
Swing transparency using JNI may be related.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…