| Author |  | 
      
        | nadler Super User
 
  
 
 Joined: February 25 2006
 Location: United States
 Online Status: Offline
 Posts: 354
 | 
          I'm streaming some news program from IE (also works from Firefox).  But it's one of those propriety streams running from its own window in the browser.  I can't use itunes or WMP to play it.  I open the stream using "Launch Appliction" from PH.  It then runs in a separate instance on IE.  I use the URL of the stream as the 'opening page' in the browser.  So I have no problem getting it to load and play from PH.  The problem is I can't shut it down or turn off the stream from PH.  There doesn't seem to be a "Close Application" command or formula.  The "Switch to Applic" command doesn't shut it down or turn off the stream.  I am sure I'm missing something but I can't figure out what.  Anyone have any suggestions how to close or shut down an application from PH?
           | Posted: July 16 2006 at 16:05 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          Have you tried sending a control-w or alt-f4 to the window?
           | Posted: July 16 2006 at 17:26 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |       | 
       
       
        |  | 
        | nadler Super User
 
  
 
 Joined: February 25 2006
 Location: United States
 Online Status: Offline
 Posts: 354
 | 
          That occurred to me after I posted the message and it does work.  I was hoping there was a more elegant solution.  I've found sometimes the send keys doesn't work because the application doesn't switch quickly enough and therefore you have to put a 'wait' command in, before you use send keys.  I would rather have it instantaneous.  But it does work.
           | Posted: July 16 2006 at 18:57 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          I believe Dave suggests switching to ph first, then to your desired app. Works more consistantly.
           | Posted: July 16 2006 at 19:38 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |       | 
       
       
        |  | 
        | Manny Senior Member
 
  
  
 Joined: March 23 2003
 Location: United States
 Online Status: Offline
 Posts: 172
 | 
          If running XP you can try the
           | Posted: October 11 2006 at 01:15 | IP Logged |   |  
           | 
 |  Taskkill command.
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          Manny,
           | Posted: October 12 2006 at 13:06 | IP Logged |   |  
           | 
 |  
 I forgot to mention this but you can also try the new ph_closewindow function.  It takes a single parameter which should be the handle of the window you want to close.
 
 Let me know if it works for you or not.
 
 Dave.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | nadler Super User
 
  
 
 Joined: February 25 2006
 Location: United States
 Online Status: Offline
 Posts: 354
 | 
          Dave, it this the correct syntax?
           | Posted: October 12 2006 at 16:36 | IP Logged |   |  
           | 
 |  
 ph_closewindow("IEFrame")
 
 It didn't work when I tried to close IE.  I now use send keys and Control-w to close the window but it doesn't always work because of timing issues.
 This new formula would certainly do the trick.
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Manny Senior Member
 
  
  
 Joined: March 23 2003
 Location: United States
 Online Status: Offline
 Posts: 172
 | 
          I'm not home yet, but is this function documented in the help file? Also is there a way to have all the functions definitions (like in the Alt-F12 help file) on-line?
           | Posted: October 12 2006 at 16:41 | IP Logged |   |  
           | 
 |  
 It would give me something to read while "working"....
 
 Edited by Manny - October 12 2006 at 21:54
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          Noel,
           | Posted: October 12 2006 at 23:49 | IP Logged |   |  
           | 
 |  
 Not quite.  The correct syntax for closing a window using the window "Class" name would be:
 
 ph_closewindow(ph_findwindow("IEFrame",0))
 
 However, I just checked and it doesnt work with Internet Explorer windows
  .  The ph_closewindow function essentially posts a WM_CLOSE message to the window and IE does not like this. 
 However, after some research, Ive found the correct way to close an IE Window based upon it's "Class" name:
 
 ph_postmsg(ph_findwindow("IEFrame",0),274,61536,0)
 
 This should do it everytime for you and should be cleaner than a sendkeys since the window doesnt even have to have focus.
 
 Manny,
 
 Not yet.  Updating the Help file was one of the things that I didnt get a chance to do.  It'll be coming soon though.
 
 I'll see what I can do to get the Help file online.  May not be too tough since the Help file initially starts as HTML anyway.
 
 HTH,
 
 Dave.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | nadler Super User
 
  
 
 Joined: February 25 2006
 Location: United States
 Online Status: Offline
 Posts: 354
 | 
          That did it!  Yet, another formula I would never have been able to figure out by myself.
           | Posted: October 13 2006 at 08:04 | IP Logged |   |  
           | 
 |  
 Thanks, Dave!
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          The next version has this new method built into the ph_closewindow function so you'll be able to just use that when it comes out.
           | Posted: October 17 2006 at 16:35 | IP Logged |   |  
           | 
 |  
 Dave.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | nadler Super User
 
  
 
 Joined: February 25 2006
 Location: United States
 Online Status: Offline
 Posts: 354
 | 
          Thanks, Dave.  In case you took my remark as a complaint (it wasn't) I wasn't complaining about the complexity of the formula, just my inability to figure out complex macros and formulas (i.e I have to continually ask you to do it for me)
           | Posted: October 17 2006 at 17:28 | IP Logged |   |  
           | 
 |    | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          Noel,
           | Posted: October 18 2006 at 21:21 | IP Logged |   |  
           | 
 |  
 No problem, definately didnt take it as a complaint
  .  No way I could have come up with that off of the top of my head.  Thank goodness for Google. | 
       
        | Back to Top |       | 
       
       
        |  | 
        | Manny Senior Member
 
  
  
 Joined: March 23 2003
 Location: United States
 Online Status: Offline
 Posts: 172
 | 
          Dave,
           | Posted: October 20 2006 at 13:47 | IP Logged |   |  
           | 
 |  Does the DCC handle this new feature?
 
 Most of my control of other applications happen on the non PH machine.
 
 Manny
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          Manny,
           | Posted: October 24 2006 at 15:38 | IP Logged |   |  
           | 
 |  
 Not yet...I'll be putting out a new DCC soon with the updated PowerHome functions included (including this one).
 
 Dave.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | Manny Senior Member
 
  
  
 Joined: March 23 2003
 Location: United States
 Online Status: Offline
 Posts: 172
 | 
          Sweeeeeet!
           | Posted: October 24 2006 at 15:51 | IP Logged |   |  
           | 
 |  
     Thanks.
 | 
       
        | Back to Top |     | 
       
       
        |  |