JNI window question

H

hilz

Hi.
I have an Java Swing application that has a JFrame. I also call into a
native dll using JNI to launch a native dialog from this dll.
This native dialog appears below the JFrame and is not visible unless
the user looks in the task bar and clicks on it.
Is there a way to make this dialog appear on top of my JFrame?
Help is appreciated.
thanks.
 
J

Jean-Francois Briere

In your native code just before launching the native dialog do:
HWND handle = FindWindow(NULL, yourmainFrameTitle);
Then use this handle as parent window handle on your native dialog.

Regards
 
H

hilz

Jean-Francois Briere said:
In your native code just before launching the native dialog do:
HWND handle = FindWindow(NULL, yourmainFrameTitle);
Then use this handle as parent window handle on your native dialog.

Regards
Thanks Jean.
My main frame has a variable name, but it always starts with a word that
i know.
is there another function that matches a regex expression for example? I
tried to find one, but can't find any.

Your help is greatly appreciated.
thanks
 
H

hilz

hilz said:
Thanks Jean.
My main frame has a variable name, but it always starts with a word that
i know.
is there another function that matches a regex expression for example? I
tried to find one, but can't find any.

Your help is greatly appreciated.
thanks


Ok, never mind... i found it.
I can use the EnumWindows to get the windows and test them one by one.

Sorry for the OT. this has nothing to do with Java!
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top