Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JNI window question

Reply
Thread Tools

JNI window question

 
 
hilz
Guest
Posts: n/a
 
      07-20-2006
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.
 
Reply With Quote
 
 
 
 
Jean-Francois Briere
Guest
Posts: n/a
 
      07-21-2006
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

 
Reply With Quote
 
 
 
 
hilz
Guest
Posts: n/a
 
      07-21-2006
Jean-Francois Briere wrote:
> 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

 
Reply With Quote
 
hilz
Guest
Posts: n/a
 
      07-21-2006
hilz wrote:
> Jean-Francois Briere wrote:
>> 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
>



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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JNI thread vs. native thread vs. JNI call bgabrhelik Java 0 09-29-2009 03:33 PM
Re: JNI: Error loading DLL from JNI DDL vasanth Java 0 01-25-2005 11:03 AM
Re: JNI: Error loading DLL from JNI DDL vasanth Java 0 01-25-2005 11:01 AM
Porting JNI Windows under JNI LINUX + Wine ? Pasturel Jean-Louis Java 5 03-03-2004 07:50 PM
IBM's JNI fails where Sun's JNI works Alex Hunsley Java 4 11-04-2003 10:34 AM



Advertisments