Sign in to follow this  

Get Swing control HWND (window handle) in c++

This topic is 1550 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

 

I've read a lot about this problem, but I haven't found the proper solution.

 

I'm working on a c++ game (and engine) which uses OpenGL as graphics API.

I've decided that I create the editor in Java with Swing. I'm using JDK 1.7 x86 version (but I'm on Win7 x64)

 

The problem is that I need the handle (HWND) of the "preview control" (a simple JPanel) in the c++ code (to initialize the OpenGL).

I know how the native wrapper works, the problem is the HWND getting.

 

I've read about the AWT solution: get awt, get graphics component, and get the window handle. It would be great for me, but it crashes and I don't know why.

 

Of course it's important that if I send the editor to the artists, they have to be able to run it without any trick (just install a JVE 1.7)

 

Has anyone any idea?

 

Thanks,

csisy

Share this post


Link to post
Share on other sites
Sign in to follow this