title: How to close external programs (Powerpoint) running on the native desktop using Java?
body: <p>I have to create an application that will automatically open a powerpoint file, let it play through, and then close it. Not only do I need to figure out HOW to close it, but I also must detect when it closes or stops.
  First option:
  I know how long each powerpoint will play for, so I can hardcode when to close the file. I just need to know how to do that. There are no methods in the desktop class (that I could find) for closing.
  Second option:
  If someone knows a microsoft powerpoint api that lets me open powerpoints and use java to progress through the slideshow and get the state or something, that'd be great. I wouldn't have to go into each presentation and count the number of slides and the transition timer on each slide.</p>
  
  <p>The opening, letting it play, and closing it is a small part of the app I need to create. But here is what I have so far with regards to THIS problem:</p>
  
  <pre><code>    File myfile = new File("PowerPoint.ppsx");
      try {
          Desktop.getDesktop().open(myfile);
      } catch (IOException ex) {
          Logger.getLogger(Sc.class.getName()).log(Level.SEVERE, null, ex);
      }
  </code></pre>