Sign in to follow this  
csisy

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this