Dim jo As JavaObject = Me
Dim handle As Long = jo.RunMethod("getWindowPointer", Array(MainForm))
Log(handle)
#if JAVA
import java.lang.reflect.Method;
import com.sun.javafx.tk.TKStage;
public static long getWindowPointer(anywheresoftware.b4j.objects.Form form) throws Exception{
TKStage tkStage = form.stage.impl_getPeer();
Method getPlatformWindow = tkStage.getClass().getDeclaredMethod("getPlatformWindow" );
getPlatformWindow.setAccessible(true);
Object platformWindow = getPlatformWindow.invoke(tkStage);
Method getNativeHandle = platformWindow.getClass().getMethod( "getNativeHandle" );
getNativeHandle.setAccessible(true);
Object nativeHandle = getNativeHandle.invoke(platformWindow);
return (Long) nativeHandle;
}
#end if