Closing External Window

Hi,
I want to close an external window (an external running application, such as InfoConnect, or NotePad etc) using a simple java program. Is it possible? What is the command to close an external window? And how do I know which window to close?
For example, there's a running application, called info-connect, and another independent java program running. How can I close the info-connect window without disturbing the other program? (is there a name for the window or something)
Thank you very much!!! Wish you all the best~
- Anson

Sorry, I hit the 'post' button a little too quick.
If it's really independent, it's gonna be very hard - though a Robot might get you somewhere.
But more importantly, there's a reason for that. How would you like it if a program just decided that a window it hadn't opened, needed to be closed? I'd find it irritating to say the least.
Don't close what you do not own.
Otherwise:Process p = Runtime.getRuntime().exec("MyProgram.exe"); // start a process
... // do some stuff
p.destroy(); // kill itBut this is probably not what you mean by independent, right?

Similar Messages

  • FileDownload UI - Closing external window

    Hi All,
        I am using the file download UI, and as I want to show open dialog box after file download, the property 'behaviour' is set to 'allow save' , and it is working fine too.
      My requrement is, after I click 'Open' or 'Save' or 'Cancel' button, the external window should close automatically. i.e. the user need not want close it.
    Any idea ?
    Thanks,
    Prabhakar.

    Hi,
    As wd doesnt java scripts closing windows at the client side will not be possible.
    Regards
    Ayyapparaj

  • Closing an external window

    Hello,
    I would like to close an external window dynamically by calling the method
    lr_myextwin->close( ) when some event occurs.
    This does not seem to work since the opened external window is still open...
    Ofcourse it is possible to manally close the external window, but I would like it to happen dynamically.
    Can any brief me in, if it possible.
    Cheers,
    Gerald

    Hi Jagruti,
       Its possible to close the external window dynamically.What you have to do is , while creating the external window instance, save the instance in the component controller as an attribute .
    Which means create an attribute in the component controller of type IF_WD_WINDOW ( In this case i have created LO_POP_UP ).
      l_cmp_api = wd_comp_controller->wd_get_api( ).
      l_window_manager = l_cmp_api->get_window_manager( ).
       CALL METHOD L_WINDOW_MANAGER->CREATE_WINDOW
         EXPORTING
          MODAL                = ABAP_TRUE
           WINDOW_NAME          = <WINDOWNAME>
          TITLE                =
          CLOSE_BUTTON         = ABAP_TRUE
          BUTTON_KIND          =
          MESSAGE_TYPE         = IF_WD_WINDOW=>CO_MSG_TYPE_NONE
          CLOSE_IN_ANY_CASE    = ABAP_TRUE
          MESSAGE_DISPLAY_MODE =
          DEFAULT_BUTTON       =
         RECEIVING
           WINDOW               = l_final_window
    When you get the instance of the window.Save it in the component controller attribute.
    wd_comp_controller->LO_POP_UP = L_FINAL_WINDOW.
    CALL METHOD L_FINAL_WINDOW->OPEN
    At later point of time , you could get this instance from compenent controller and you can call that in your method whenever and whereever necessary , so that you could close the window in a smooth fashion.
    mywindow = wd_compcontroller->LO_POP_UP
    mywindow.close().
    Thanks
    Anzy.
    mark this thread as closed if this solves your problem.

  • Closing the NonModel External Window in Webdynpro

    Hi,
    I have a Webdynpro Application, in which i used to call the webdynpro application in a Separate external window by using the below code.
    String depObjectName =wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
    WDDeployableObjectPart depObjectpart=WDDeployableObject.getDeployableObjectPart(depObjectName,"TestApp",WDDeployableObjectPartType.APPLICATION);
    String url = URLGenerator.getApplicationURL(depObjectpart) ;
    *// Code to Popup the View in External window by calling the Application                          *
    window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(url,"Update View");
    wdContext.currentContextElement().setCtx_WindowInstance(window);
    window.setWindowSize(625, 225);
    window.setWindowPosition(50, 75);
    *window.setTitle("Update View");          *
    window.show();
    This opens the Separate external window and after editing some fields, I need to Update the DB and close the window.
    When i try to use the code,
    window.destroyInstance();
    The window is not getting closed. I have used the window instance as the static IWDWindow window, still i am not able to close the window.
    Anyone Please let me know how to close the External Non Model Window.
    Thanks and Regards,
    Sekar

    Hi Sekar,
    my suggestion is to open another window that contains html code which invokes opener . close() on the parent window - your window to be closed. This worked for me and made my day.
    I open an HTML file created as IWDCachedWebResource as nonModalExternalWindow over a LinkToAction which invokes onActionClose. There is a second window opening for a short moment which will be closed by its onLoad event.
    The HTML code is basically sporting a < script >-section which contains a call to opener . close().
    regards,
    Christian
    Ps: sorry, I can't post the code - it simply does not work... Had the same problem days ago with another thread .

  • Closing the external window

    Hi,
    I am new to webdynpro ABAP, please someone help me in how to close the extenal window, from the application running on the external window.
    I am actually creating a URL for a webdynpro component and I am running it on the external window, now I want to close the application browser, so that I can go back to the source window.
    Regards,
    Kamaraj

    Hi,
    if you are using URL external window then they are two separate sessions. You have no connection as parent and child window and nothing forbids the user to go from one window to another window.
    If this is really your use case and you want to close your own application/window by an button action or event handler method. Then you have to find out a way to close your application by an action.
    see this forum discussion.
    [FORUM|Re: Close External Window in Web Dynpro Application]

  • Close External Window in Web Dynpro Application

    Hi Folks,
    I am working on a development in Web Dynpro and I am pretty new to this topic, so I seek your help.
    The scene is:
    I have created a Web Dynpro application in which I open an URL using CREATE_EXTERNAL_WINDOW method of the Window Controller. I am able to open the window but not able to close it.
    I tried using methods,
    CLOSE()
      and
      SET_CLOSE_IN_ANY_CASE()
      but no success.
    Please guide me if anything more needs to be done for closing the opened window.
    Thank you.
    Sud.

    Thank you Thomas,
    You correctly pointed out, I was trying to close the external window from my source window.
    More precisely, I have a WD application which has a button (Search) on one of its views. On click of 'Search' button, I open a new window using 'CREATE_EXTERNAL_WINDOW' passing the URL 'www.google.com'.
    Till this point its fine, but now I want to close this newly opened window. As you said now these are 2 different sessions and cannot communicate anymore, so any guidance how to close this new window?.
    OR
    Is this the only way to call an URL i.e using CREATE_EXTERNAL_WINDOW? Is there any other way to call an URL without closing my current running WD application?
    Request your  help......
    Thanks.
    Regards,
    Sud....

  • Application lock on open external window

    Hi everybody,
    I have problems with opening a new browser window pointing to a folder on the network.
    If the user has access to the folder everything is working fine.
    If the user has no rights to access the folder, the user gets an error message and the window stays empty. After clicking okay on the error message and closing the window the  user can continue working in the application.
    If the folder which should be display does not exist the user gets an error message.
    After clicking oay on the message he can return to the application. But there the 'progress circle' is still running and it cannot abort or do anything! The user has to close the application and login again.
    Is there a way to handle the external window in any way after having it opened and the calling method was left?
    Any hint or advice is highly appreciated!
    Best regards,
    Roland

    Hi,
    Do this way... So that there will not be a minimise option, close option. and control will be there inside the Window and till the time user closes the window he cannot perform any actions on any other screens.
         //Added below code to open a new window
              IWDWindowInfo info =
                   wdComponentAPI.getComponentInfo().findInWindows("WD_vendorTable");
    //Where WD_vendorTable is a window with the desired view embedded inside it.
              IWDWindow win =
                   wdComponentAPI.getWindowManager().createModalWindow(info);
              wdContext.currentContextElement().setVa_VendorWinName(win);
    //Save this window information in a context variable(declared at component level and mapped to the parent view and to the window(child) view)
              win.setWindowSize(300, 300); //Desired window size
              win.setWindowPosition(600, 100); //Desired window position (from top left cornor)
              win.setTitle("Vendor Details"); //Desired window title
              win.show();
    To close this window
    create a button inside it and inside the button's action
    IWDWindow win=wdContext.currentContextElement().getVa_AssetNoWinName();
    win.destroyInstance();
    Regards,
    Srinivas.

  • How lock or hide URL LOCATION in a external windows WDA

    Hello guys...
    I am traying to hide or block the URL which i am using in a external window. I have coded this:
       call method lo_window_manager->create_external_window
    exporting
       url            = lv_url
       modal          = abap_true
       has_menubar    = abap_false
       is_resizable   = abap_true
       has_scrollbars = abap_true
       has_statusbar  = abap_false
       has_toolbar    = abap_false
       has_location   = abap_false
    receiving
       window         = lo_window2.
    *lo_window2->open( ).
    But, firstly the MODAL parameter doesn't work with external windows (It's Obsolete) So I can't use it, because I have to forbid the navigation between windows. I tried to close the main windows before open URL but it doesn't work either.(Appear a waring that you window wants to be closed) so then I used that:
      lo_windows->fire_exit_url_plg(
        url = lv_url                              " string
      lo_windows =   wd_this->get_windows_ctr( ).
        lo_windows->fire_exit_close_plg(
          close_window = 'X'                     " wdy_boolean
    That is Ok BUT I can't BLOCK the URL or even HIDE it. SOMEBODY give the light.!!!!! pleaseee..

    You are complexing with 2 problem with 2 options.
    1. Blocking url on the external window
    2. Closing the previous window.
    1. parameter model is indeed obsolete, so only has location parameter  would help you to block the URL and it will not work for the requirement 2.
    2. When you use exit plug and navigate to new URL, your window would close but new window would not open with address bar blocked.
    No solution is fitting for your both requirements.
    Probably you have seen this example application WDR_TEST_EXIT_WITH_CLOSE
    See if it fits in your case.

  • How to create external window on top of other window?

    I create an external window from my web dynpro component. How to make sure the new window is created on top, not in the back? My web dynpro component is accessed via sapgui and browser.
    Thank you
    Edited by: Vincent Cao on Jun 15, 2010 5:25 AM

    Yes, by default it should be on top.But mine is displayed in the background.
    Logic is:
    1 Window A (or SAPGUI A) has a pop window PA with a button "OK"
    2 Press "OK" button, PA window is closed. And fire an event to window A
    3 A get the event, refresh itself and create an external window.
    Part of codes:
          window = lo_window_manager->create_external_window(
              url            = i_url
              title          = title
              modal          = modal  " abap_false
              has_menubar    = has_menubar "abap_true
              is_resizable   = is_resizable "abap_true
              has_scrollbars = has_scrollbars "abap_true
              has_statusbar  = has_statusbar "abap_true
              has_toolbar    = has_toolbar "abap_true
              has_location   = has_location ). "abap_true
          IF width IS NOT INITIAL AND height IS NOT INITIAL.
            window->set_window_size( width  = width  height = height ).
          ENDIF.
          window->open( ).

  • Again about External Window in WDA

    I have some troubles with running new processes in E-Recruiting.
    It is necessary to run my process when I'm pushing the button in the requisition form. I'm creating external window with method CREATE_EXTERNAL_WINDOW and after that my process is running. This chain is workable. But when I'm closing this window with my process there is no new small window which displays that the session is completed.
    Call method:
      call method lo_window_manager->create_external_window
        exporting
          url            = lv_url
          modal          = abap_false
          has_menubar    = abap_true
          is_resizable   = abap_true
          has_scrollbars = abap_true
          has_statusbar  = abap_true
          has_toolbar    = abap_true
          has_location   = abap_true
        receiving
          window         = lo_window.
    I don't find any usefull parametrs in this method.

    Sorry I might be about to be rude,
    But are you/your users crazy? They actually will complain if a session termination popup doesn't appear? You must have the most observant and tech aware end users in the world. Most of the users I deal with install pop-up blockers that stop the portal session termination popup - the ability to deal without it in WDA was a blessing. If your users are really that "aware" of session management then explain to them that WDA handles this within the same window.
    I really cannot understand this improvement in functionality offered by WDA is a problem...

  • Close external window in NW04s

    Hi,
    We are using the following API in order to close an external window: TaskBinder.getCurrentTask().getClient().sendRedirect("javascript:window.close();",0);
    After closing the window, the object in the backend system remain locked (and not released). it seems that the session remains alive and hence the object is locked.
    If we close the window with the X of the window, the object of the backend is released as required.
    As suggestions?
    Thanks,
    Aviad

    Hi AVIAD,
    Check this.
    Step 1: Take a context attribute(WindowInstance) of type “com.sap.tc.webdynpro.services.session.api.IWDWindow”.
    Step 2: Take a CloseButton in the View(DisplayView) that is used as a embed View of external Window.
    Step 3:
    When you are calling the external window set “WindowInstance”
    public void onActionDisplayExternal Window(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionDisplayResult(ServerEvent)
         IWDWindowInfo windowInfo =(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows(
         "DisplayWindow");
    //        create the Window
         IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
         window.setWindowPosition(WDWindowPos.CENTER);
         window.setTitle("WindowTitle");
         window.setWindowSize(100,100);
    //        Save WindowInstance in Context
         wdContext.currentContextElement().setWindowInstance(window);
    //        and show the window
         window.show();
         //wdThis.wdFirePlugInDisplay();
        //@@end
    Step4: Associate action “CloseWindow” with the “CloseButton
    ” and destroy the window instance inside it.
      public void onActionCloseWindow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionCloseWindow(ServerEvent)
       IWDWindow window = wdContext.currentContextElement().getWindowInstance();
       window.destroyInstance();
        //@@end
    External Window
    Re: Exit button error...
    Regards,
    Mithu

  • Closing a Window.

    Hi ,
    My requirement is such that,i have a Button in my View Layout.On Click of that Button the Window should be closed.
    I have gone through the forum and tried out various combinations,but i could not get it solved.
    Can i have step by step approach for the same.
    Thanks and regards,
    Chandrashekar.

    Hi chandrashekar,
    Try this.It will only close the external window.
    1> Take a button say(Close) inside the externalview layout.Create an external window embed the external view.
    2> Take a WindowInstance context attribute of type <b>com.sap.tc.webdynpro.services.session.api.IWDWindow</b>
    when you are opening the external window save the window instance
    IWDWindowInfo windowInfo =(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows(
    "Put Window Name here");
    // create the Modal Window
    IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
    // Display window in center
    window.setWindowPosition(WDWindowPos.CENTER);
    window.setTitle("PopUp window");
    window.setWindowSize(100,100);
    // Save WindowInstance in Context
    <b>wdContext.currentContextElement().setWindowInstance(window);</b>
    // and show the window
    window.show();
    Inside the action of external window close button use this code.
    IWDWindow window = wdContext.currentContextElement().getWindowInstance();
    window.destroyInstance();
    Regards,
    Mithu

  • Why does captivate hang when it is closed in window 8.1 professional ? How is it solved?

    Why does captivate hang when it is closed in window 8.1 professional ? How is it solved?

    Hi,
    Do you see the issue every time you close captivate or is it only in some scenarios? Does it show any error messages? What captivate version are you using (64 bit or 32 bit)? Can you provide some more information or screenshots which can help us reproduce the issue.
    Tamish

  • Problem with Absolute Navigation (External Window) and Light Framework Page

    Hi All,
    We are using Light Framework page for the portal devolopment. We have an application including two webdynpro iviews where absolute navigation is used to traverse from first iview to second iview (When user clicks a button on first iview). We are showing the second iview in external window (SHOW_EXTERNAL). When ever i clicks the button to traverse to second iview, i am getting an exception.
    When we are showing it in same window (SHOW_INPLACE), it is working fine. But the iview is appeared in half of the page with scrollbars. It is working fine with default framework page (with both options SHOW_INPLACE and SHOW_EXTERNAL) and dispalyed in original size as mentioned in iview properties.
    Could you please suggest us whether there is any work around for this.
    Thanks,
    Sudheer

    Hi Kathiresan
    I couldn't see the address bar of the window (In which second iview is getting displayed). But i can observe no parameters that i passed from first iview is visible in the view source of the second iview (When SHOW_EXTERNAL is used in absolute navigation). I could see all the parameters in the view source (when SHOW_INPLACE is used for absolute navigation). But i am using the same url for both the options (for SHOW_INPLACE and SHOW_EXTERNAL).
    I doubt about the url being passed when SHOW_EXTERNAL option is used. But when we checked in debug, The correct url is being triggered (Atleast from first iview). Is there any way that could display the second window with address bar. What is making difference  between SHOW_INPLACE and SHOW_EXTERNAL with absolute navigation and light framework page.
    Could someone please suggest.
    Thanks,
    Sudheer.

  • Closed Captioning Window slow to open

    We have a team member using CP7 on a Win7 machine having a delay when he opens the closed captioning window.  It can take up to 10 seconds for the window to open. 
    We just put him on someone elses machine and it didn't do that even when logged in with his credentials.  He says it has done that through all the versions of Captivate that he's used on the XP and Win7 platforms and on previous computers.
    Does anyone have an idea of what might be causing this?
    Thank you,
    Susan

    Here's the fix to which I was referring, supplied by a colleague on Linked-In:
    "There are 2 instances of a codec that need to be turned into a .bak file.
    First you go into C/program files/Adobe Media Encoder CS5/MediaIO/codecs to find a file "SurCodeWrapper.vca" Change it to "SurCodeWrapper.vca.bak" do the same thing in C/program files/AdobePremiereProCS5/MediaIO/codecs with the "SurCodeWrapper.vca file there too. This WILL fix the lag. I think you lose surround sound encoding by doing this, but this hasn't been a problem for me."

Maybe you are looking for