How to bring windows of other application to top

Hi,
Does anyone knows how to give the focus to other application's window using Java?
Thanks,
yinmos

You can do it using JNI. Also, to do it you need to know window handle of the other application.
JNIWrapper for windows may help you with JNI and other platworm related functionality.
Check the http://www.jniwrapper.com
Hope it helps,
EToporov

Similar Messages

  • How to bring the data from application server to presentation server

    hi,
    i have one problem,i have written the program which will open the files in the application server when we run the program in the background(sm37),the same data from application server i want to bring into presentation server in the format of (.csv),how to bring the data from application to presentation server can any body help me on this  topic.folowing is the code .
    *& Report  ZPFA_HIER_LOAD
    REPORT  ZFPA_HIER_LOAD.
    *---- Declaration of Oracle connectioN
    DATA con_name LIKE dbcon-con_name VALUE 'COMSHARE'.
    DATA: MFL1(9),MFL2(5),MFL3(9),MFL4(2),MFL5(8) TYPE c.
    DATA : mfilename type string.
    data: begin of matab1 occurs 0,
          MFL1(9) TYPE C,
          MFL2(5) TYPE C,
          MFL3(9) TYPE C,
          MFL4(2) TYPE C,
          MFL5(8) TYPE C  ,
         end of matab1 .
    data: setid(8) type c.
    data: begin of source occurs 0,
          setid(8) type c,
          end of source.
    *PARAMETERS : p_pfile LIKE filename-FILEEXTERN.
    *PARAMETERS : m_bsenty(8). " type c obligatory.
    *mfilename = P_PFILE.
    EXEC SQL.
      SET CONNECTION :con_name
    ENDEXEC.
    EXEC SQL.
      CONNECT TO :con_name
    ENDEXEC.
    EXEC SQL PERFORMING get_source.
      SELECT set_id FROM UNIT_SET INTO
      :setid
      ORDER BY SET_ID
    ENDEXEC.
    start-of-selection.
    LOOP AT SOURCE.
      REFRESH matab1. CLEAR matab1.
      EXEC SQL PERFORMING evaluate.
    SELECT TO_CHAR(MEM_ID),TRIM(TO_CHAR(MEM_PID)) FROM UNIT_TREE INTO :MFL1,
    :MFL5
    where set_id = :SOURCE-SETID ORDER BY MEM_ID
      ENDEXEC.
      if SOURCE-SETID = '80000000'.
       mfilename = '/tmp/aesorg'.
      elseif SOURCE-SETID = '80000006'.
       mfilename = '/tmp/Consolidation_Manager'.
      elseif SOURCE-SETID = '80000010'.
       mfilename = '/tmp/10org'.
      elseif SOURCE-SETID = '80000012'.
       mfilename = '/tmp/20org'.
      elseif SOURCE-SETID = '80000018'.
       mfilename = '/tmp/30org'.
      elseif SOURCE-SETID = '80000025'.
       mfilename = '/tmp/40org'.
      Endif.
      mfilename = '/usr/test.dat'.
    ************************This was i tried***********************
      open dataset mfilename for output in text mode encoding default." IN
    *TEXT MODE ENCODING DEFAULT.
    if sy-subrc <> 0.
    exit.
    endif.
    close dataset mfilename.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
         FILENAME         = MFILENAME
         FILETYPE         = 'ASC'
       TABLES
         data_tab         = matab1
       EXCEPTIONS
         file_write_error = 1
         invalid_type     = 2
         no_authority     = 3
         unknown_error    = 4
         OTHERS           = 10.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
      clear matab1.
    ENDLOOP.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
    close dataset mfilename.
         MFL5 = '0'.
       CLEAR MFL5.
    FORM evaluate.
      if MFL5 = -1.
        MFL5 = ''.
      ENDIF.
      concatenate MFL1 ','   into MFL1.
      concatenate MFL1 ','   into MFL3.
      matab1-MFL1 = MFL1.
      matab1-MFL2 = 'ZBUE,'.
      matab1-MFL3 = MFL3.
      matab1-MFL4 = ' ,'.
      matab1-MFL5 = MFL5.
      append matab1 .
      CLEAR MFL1.
      CLEAR MFL2.
      CLEAR MFL3.
      CLEAR MFL4.
      CLEAR MFL5.
    ENDFORM.
                     "evaluate
    *&      Form  GET_SOURCE
          text
    FORM GET_SOURCE.
      source-setid = setid.
      append source.
      clear source.
    ENDFORM.                    "GET_SOURCE

    Hi Rammohan,
    You cannot use OPEN DATASET to transfer data from application server to presentation server.
    You can do the following :
    <b>Do 1st point in BACKGROUND</b>
    1. Read the data file from application server into an internal table using OPEN DATASET
    <b>Do 2nd point in Foreground</b>
    2. Once you get the data into an internal table, then use FM GUI_DOWNLOAD to download it on presentation server
    You cannot use the above 2 point together in Background because its not possible. Hence you need program it partially in background and partially in foreground.
    Best regards,
    Prashant

  • Find names of all open windows including other applications besides LabView VIs

    Hi All, I have researched this subject, i.e., to find names of all open windows including other applications besides LabView VIs, but found no solution. Could someone suggest a solution to this?  Thanks.

    Hi,
    Certainly! The Windows API Function Utilities (32-bit) for LabVIEW includes set of LabVIEW libraries (llb) with VIs that make calls to the Windows Application Programming Interface (API) for managing and controlling windows (minimize, maximize, move, resize, rename, close, and so on) including task list with names of windows application running. The Readme.doc contains information on running these VIs.
    Attached below is a zipped file with a VI that list the names of all opened windows.
    Tunde
    Message Edited by Tunde A on 04-18-2007 02:28 PM
    Attachments:
    List Windows Application LV8.0.zip ‏55 KB

  • How can I communicate with other applications from my Java application?

    Hello,
    I need help about how can i communicate with other application(say textpad.exe/wordpad.exe/MS word.exe) from my Java program.
    More precisely, I need to know how i can get the current position of the cursor whether it is in any .txt/.doc files, then I may write some text in my java application and click a button and then my program will append the line(string) in that position of the file which is running under another appliction(Notepade.exe/MSword.exe).
    Please provide me some help.

    I may be wrong (and anyone, please correct me if so), but Java may not be the best tool for something such as this. I envision that you'd have to make some OS calls such as calls to the user32.dll, and while this can be done through the JNI, you'd still have to have a C or C++ program doing the dirty work.

  • How to get links from other applications to open a new Firefox window

    I have non-Web browser applications that want to open browser windows. I have Firefox as my default Web browser. When these other applications pass a URL to Windows, Windows passes the URL to Firefox. Unless there are no Firefox windows running, Firefox then opens the URL in a new tab of the most recently used Firefox window. I would prefer that Firefox open a completely new window. Where can I find the setting for this behavior?
    Thank you,
    Dan

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    See also:
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    *http://kb.mozillazine.org/Preferences_not_saved

  • Copying text from Oracle Applications Window to other Application windows

    Hi All,
    I am not able to copy text from oracle applications windows to my other application windows.
    Please advise.
    Thanks,
    Amit

    Check in your organization who is able to copy the text. Then from that user machine, who is able to copy text, copy identitydb.obj file and copy to your machine (overwrite the current one)
    Then clear its jcache and browser cache one time. From that point forward they can connect to both instances. This is accomplished as follows:
    1. On each Client PC, you will need the new instance 1 (TEST) version of this identitydb.obj file located C:\Program Files\Oracle\identitydb.obj (default location )
    2. Clear Jinitiator jcache : On the client PC delete all files found in c:\Program Files\oracle\jinitiator 11727 Export\jcache
    3. Clear browser cache:
    a) Netscape : Edità Preferencesà Advancedà cache and delete Memory Cache and Disk Cache
    b) Internet Explorer : Toolsà Internet Options à delete Temporary Internet Files
    For any further assistance pls. feel free to ask.
    Regards,

  • How to bring Windows 7 snap window to OS X to work with two apps/ docs side

    I quite like the feature that windows 7 has to allow working with documents or applications side by side filling the screen. I know that i can resize each window but it seems a little fiddly and i'm thinking there must be a way to have it automated.
    How can i get this feature. Could automator be used although i haven't used it before. Had a look at it before and find it a little confusing as i don't know how to use it.
    Or are there any applications?
    Would love your help.
    Message was edited by: prstewart

    Matthew Morgan wrote:
    your best bet is sending apple a feature request
    I agree. That would be a cool feature.
    Kind of like a refinement of what Spaces does. Being able to sub divide the screen into work areas.
    With screens getting so large it would be very useful.
    yes, but I wouldn't bet a lot of money on apple implementing it. OS X has its own host of features like spaces and exposé and implementing this one might be too much like copying Windows which they hate to do...
    Matt

  • How to get "Windows Installer CleanUP" application.

    I use PC Vista Home Premium, and I use Adobe Acrobat Standard 8, till now it is working very well and nothing wrong. I would like to install an application of "Windows Installer CleanUP" to my PC for sometime in future I may need to use it, but I do not know how to get it to download and install the "Windows Installer CleanUP" into my PC Vista Home Premium.
    Please help and teach me. Thank you for your time and attentions.

    Since that is a MicroSoft product, you might have more luck at MicroSoft support site or forum dealing specifically with MicroSoft products.

  • How to execute or call other application

    I have doubt in executing or calling any exe file using java application.
    For example: i have a button. If i click on that button, then any application (eg. any exe file, any program file, etc) will execute and come out in the different frame. Now, i don't know how to make the coding.
    I need the helps. Please give me any code or ideas.
    Thanks very much

    Sorry. if you are writing a sample program just to get a feel of Java, then the following is sufficient. Note that I have added "throws Exception" after the "main" method signature.
    import javax.swing.JOptionPane;  // import class JOptionPane
      public class Welcome4 {
      // main method begins execution of Java application
         public static void main( String args[] ) throws Exception
            JOptionPane.showMessageDialog(
               null, "Welcome\nto\nJava\nProgramming!" );
             String command = "d:\\test\\test.bat";
         Process p = Runtime.getRuntime().exec(command);
         p.waitFor();
         System.out.println("done");
            System.exit( 0 );  // terminate application
         }  // end method main
      }  // end class Welcome4

  • How to get feeds from other application

    hi,
    i m trying to devlope an web application in which some input will come from some other site and it will effect my page dynamically.
    but d main thing is i dont know how to do it .
    pls tell me how to do it
    thanx

    but d main thing is i dont know how to do it .
    pls tell me how to do itPlease make the extra effort to write out words such as "please" and "the". The extra keystrokes won't cost much in the way of time, and the enhanced clarity will be appreciated by those communicating on a forum with international readership. Also, it will give the appearance that you take your question seriously, which will in turn make your question look more interesting to answer.
    So, to answer your question, first things first: Learn how, then do it*. If you've tried something and are running into a snag, we'll be happy to help, but this forum is not conducive to providing an entry-level Java EE tutorial.
    ~
    * Look into having a servlet handle the request, delegate to a service to make the appropriate connection and obtain the content, populate the required model, and forward the model to the view.

  • [SOLVED] gnome: how to move window to other monitor with hotkey?

    now if I understand right gnome does not support a hotkey or option to move a window to another monitor by default (eg. after having been installed with
    pacman -S gnome
    so I think the solution is to use an alternate window manager (I think the default is metacity) so my question is which window manager should I use that has this feature (criteria are relatively lightweight, stable and easily set up)? also can anyone point me to instructions on how to install a non-standard window manager with a desktop environment?
    thanks in advance and sorry for the newbie question.
    Last edited by crashandburn4 (2013-07-15 02:03:08)

    I don't use gnome, but if you extend the desktop, don't you just have to move the window out of the view of the one screen to the other?
    I'm using i3, a tiling window manager. it's very lightweight and easy to setup. just install the whole group "i3" together with the package "dmenu", edit ~/.xinitrc to run "exec i3" and start it using the startx command
    you can use the arander to configure how the screens are aranged.
    in i3 you can move a whole "desktop" to another screen, or just move programms to other "desktops", just read the manual on their website

  • How to activate window, not app?

    I'm trying to write a very simple applescript to just create a new
    Terminal window and set it to be frontmost (i.e. so it has focus)
    without raising all the other Terminal I have open. The following
    creates the new Terminal window but results in all the other Terminal
    windows I have open behind my other windows being raised, which I'm
    trying to avoid:
    tell application "Terminal"
    activate
    do script ""
    end tell
    I stumbled on an old thread that seemed to be asking the same
    question at http://groups.google.com/group/alt.comp.lang.applescript/browse_frm/thread/31a26 61b7ee29f06, but I don't see how the example given accomplishes this. Can anyone help?
    Thanks!
    Josh
    [Note: Cross posted from http://groups.google.com/group/alt.comp.lang.applescript/browse_frm/thread/b1fee 62777be00e2, as I haven't had any responses on the newsgroup.]

    _PLEASE NOTE_: A few hours ago I inadvertently posted this as a reply to Pierre L. (which is okay, as I'd like him to have a look at it as well). But, in the meantime, I've made a very small change to the Finisher_.app, and I've included that in this response -- it's probably totally unnecessary, but could conceivably improve the overall reliability of this approach. There is one other issue I'm a bit concerned about (although I haven't had any problems); but, if you should get an error message regarding the PID number ("doesn't exist"), let me know and I'll see what I can do about it.
    No promises, and I've sort of lost track of your original goal, but you might try this double-pronged approach:
    1) paste this script into your editor and save it as "Starter_" _as an application to the desktop_:
    tell application "Terminal"
    set visible of every window whose visible is true to false
    do script ""
    set WinID_ to item 1 of every window
    end tell
    tell application "Finisher_" to activate
    2) Now paste the following script into a fresh editor window and save it as "Finisher_" _as an application to the desktop_:
    set PIDlist_ to do shell script "ps -cx"
    set PIDcnt_ to count paragraphs of PIDlist_
    repeat with i_ from 1 to PIDcnt_
    set TarPar_ to paragraph i_ of PIDlist_
    if TarPar_ contains "Starter_.app" then
    set Starter_PID to characters 1 through 5 of TarPar_ as string
    exit repeat
    end if
    end repeat
    tell application "Terminal" to activate
    do shell script "kill " & Starter_PID
    *From this point on, ignore the Finisher_.app on the desktop* (it probably can be saved elsewhere).
    Now arrange the desktop as you wish, with Terminal windows you can afford to lose (but I don't expect you will). Then double-click "Starter_.app" and see what that buys you. Once again, the original Terminal windows should be retrievable by quitting and relaunching Terminal.
    This works for me to bring up a new Terminal window (only) at the front of all windows of other applications, with Terminal in focus. And, once again, seems to me a lot of other things could be accomplished with this approach, but we'll see.

  • How Bridge communicates with third party applications?

    Hi,
    Is it possible to communicate between Adobe Bridge and a third party application using Bridge SDK?
    I want to learn how Bridge can communicate with other application? Bridge SDK have samples that explain how Bridge communicates with other Adobe applications like Photoshop and Indesign. Can anyone guide me or provide me a sample where Bridge communicates with a third party application?
    Thanks.

    As an example, this shows one way of getting a list of selected files from Bridge via Photoshop using C#
    using System;
    using System.Collections;
    using ps = Photoshop;
    namespace getBridgeFiles
        class Program
            static void Main(string[] args)
                ps.ApplicationClass app = new ps.ApplicationClass();
                String Code = "var fileList;"+
    "if ( BridgeTalk.isRunning( 'bridge' ) ) {"+
    "var bt = new BridgeTalk();"+
    "bt.target = 'bridge';"+
    "bt.body = 'var theFiles = photoshop.getBridgeFileListForAutomateCommand();theFiles.toSource();';"+
    "bt.onResult = function( inBT ) { fileList = eval( inBT.body ); }"+
    "bt.onError = function( inBT ) { fileList = new Array(); }"+
    "bt.send(8);"+
    "bt.pump();"+
    "var timeOutAt = ( new Date() ).getTime() + 5000;"+
    "var currentTime = ( new Date() ).getTime();"+
    "while ( ( currentTime < timeOutAt ) && ( undefined == fileList ) ) {"+
    "bt.pump();"+
    "$.sleep( 100 );"+
    "currentTime = ( new Date() ).getTime();"+
    "}}"+
    "if ( undefined == fileList ) {"+
    "fileList = new Array();}"+
    "fileList = decodeURI(fileList.toString());";
                String RC =  app.DoJavaScript(Code, null, null);
                ArrayList list = new ArrayList();
                list.AddRange(RC.Split(new char[] { ',' }));
                for (int index = 0; index < list.Count; index++){
                    Console.WriteLine(list[index]);
                Console.ReadLine();

  • How do I find out what application is  connected to my Nano (2nd Gen.)

    When I try to eject it it says "The iPod cannot be ejected because it contains files that are in use by another application."
    Does this happen to anybody else, and how do I find the other application so I can eject me iPod Nano (2nd Generation)?

    Are you playing a song in iTunes that listed in contents of iPod while it is connected. Try going to your music lib and play a song and disconnect your iPod.
    Also, make sure you are not located in some sub dir that utililizes iTunes.
    You can also hit 'ctrl,alt,delete' to see what applications are running on your PC.

  • How do you use the windows User32.dll Library functions to read variables from other applications that are running

    I am trying to read a text box from a programme running at the same time as my Labview application using calls to the Windows
    User32.dll. I believe I need to find the window handle for the 'form' containing this text string and use this together with
    various other defined input variables to access the sting.
    I have no experience of using this 'Call Library Function Node', but have an understanding of the 'C' programming language. Does anyone have
    example Labview code showing how this might be done.
    Thanks

    If you're trying to access information that's being displayed in the window of another application and that application has no ActiveX interface, then yes, Windows calls can be used. There's a very good example on calling DLLs that ship with LabVIEW. Open the Example Finder (Help->Find Examples) and switch to the Search tab. Enter "Call" in the search box and open the VI "Call DLL". Run the VI, select any of the examples, and click the "Open Example VI..." button. That shows you how to call a DLL.
    Now, given that you have no experience in calling DLLs, have only an "understanding" of C (which to me means you have never written something like a DLL), and don't seem to know that much about what Windows functions you may need, you're going to find this route pretty difficult, especially since you have to deal with Windows API calls, which are not always that easy to do from LabVIEW.
    Let me propose an alternate solution. Go over to http://www.autoitscript.com/autoit3/ and download AutoIt. This is an automation tool that allows you to automate just about anything you want. It has an ActiveX interface that you can call from LabVIEW. I've attached an example VI that shows you how to use it to get the value of a text box from one of the tabs in the computer "System Properties" control panel applet.
    Attachments:
    AutoIt Example (v7).vi ‏25 KB

Maybe you are looking for