Not sure .. could expose them as an opaque handle to a bytebuffer, and then the addresss of that bytebuffer would be the handle. However you really really could screw around if you do that ...
a small hackup - ppossibly usefull?
private void printInternal() {
try {
long hdc = -1;
long hwnd = -1;
Object displayImpl = null;
Method[] displayMethods = Display.class.getDeclaredMethods();
for(Method m : displayMethods) {
if(m.getName().equals("getImplementation")) {
m.setAccessible(true);
displayImpl = m.invoke(null, null);
break;
}
}
Field[] windowsDisplayFields = displayImpl.getClass().getDeclaredFields();
for(Field f : windowsDisplayFields) {
if(f.getName().equals("hwnd")) {
f.setAccessible(true);
hwnd = (Long) f.get(displayImpl);
continue;
}
if(f.getName().equals("hdc")) {
f.setAccessible(true);
hdc = (Long) f.get(displayImpl);
continue;
}
}
System.out.println("Address of hWnd: " + hwnd);
System.out.println("Address of hDc: " + hdc);
} catch (Exception e) {
e.printStackTrace();
}
}