JNI window question

Discussion in 'Java' started by hilz, Jul 21, 2006.

  1. hilz

    hilz Guest

    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.
     
    hilz, Jul 21, 2006
    #1
    1. Advertising

  2. 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
     
    Jean-Francois Briere, Jul 21, 2006
    #2
    1. Advertising

  3. hilz

    hilz Guest

    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
     
    hilz, Jul 21, 2006
    #3
  4. hilz

    hilz Guest

    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
     
    hilz, Jul 21, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Hunsley

    IBM's JNI fails where Sun's JNI works

    Alex Hunsley, Nov 3, 2003, in forum: Java
    Replies:
    4
    Views:
    869
    Alex Hunsley
    Nov 4, 2003
  2. Pasturel Jean-Louis

    Porting JNI Windows under JNI LINUX + Wine ?

    Pasturel Jean-Louis, Feb 29, 2004, in forum: Java
    Replies:
    5
    Views:
    939
    Pasturel Jean-Louis
    Mar 3, 2004
  3. vasanth
    Replies:
    0
    Views:
    2,763
    vasanth
    Jan 25, 2005
  4. vasanth
    Replies:
    0
    Views:
    635
    vasanth
    Jan 25, 2005
  5. bgabrhelik
    Replies:
    0
    Views:
    877
    bgabrhelik
    Sep 29, 2009
Loading...

Share This Page