| Author |  | 
      
        | smarty Super User
 
  
  
 Joined: May 21 2006
 Location: United States
 Online Status: Offline
 Posts: 729
 | 
          I am using a combination of PowerHome and Xlobby to interact with Winamp.  I use Powerhome to display and annouce the current radio station.  I use Xlobby's Shoutcast plugin to "dial into" many different radio stations.  The plugin does this by sending Winamp a "*.PLS" file to "find" the radio station.
           | Posted: September 30 2006 at 16:39 | IP Logged |   |  
           | 
 |  
 Here is the problem:  Periodically, Winamp will open a dialogue box (Winamp - Open Files).  I guess this occurs when the radio station is not available or when the plugin sends bad ".PLS" information and Winamp freaks out.
 
 Anyway, this open dialogue box causes any of my other PowerHome announcments to get screwed up (they form a queue until the dialogue box is closed).
 
 What I would like to do is use an "If" statement to see if this window is open (each time after a radio station change) and then close it.
 
 Is there a way to do this from within Powerhome?
 
 __________________
 Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          You could use the Window Spy to first get the window's handle then check for it with ph_findwindow.
           | Posted: September 30 2006 at 17:56 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |       | 
       
       
        |  | 
        | smarty Super User
 
  
  
 Joined: May 21 2006
 Location: United States
 Online Status: Offline
 Posts: 729
 | 
          Yes, Window Spy or Girdier would give the classname or title of the window for the function "ph_findwindow".  "ph_finwindow" would then tell me if the window is open or not (1/2 of the battle).
           | Posted: October 01 2006 at 11:13 | IP Logged |   |  
           | 
 |  
 I hope I am not missing the obvious, but I am stuck on how I would actually close the window if I detect that it has opened.  I am missing something....
 
 __________________
 Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          Oh! You could try ph_switchto( s, n ) then ph_sendkeys("{esc}").
           | Posted: October 01 2006 at 12:48 | IP Logged |   |  
           | 
 |  
 Edited by TonyNo - October 01 2006 at 15:37
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | smarty Super User
 
  
  
 Joined: May 21 2006
 Location: United States
 Online Status: Offline
 Posts: 729
 | 
          Making some progress.....
           | Posted: October 01 2006 at 14:22 | IP Logged |   |  
           | 
 |  
 I am now able to detect if the window is open (or not), and I am able to "switch to it/bring it to present focus".
 
 However, the ph_sendkeys("{ESC}") does not seem to close it.
 
 If I simply hit the "Esc" keyboard key, the window does close.  So, it seems that I am not able to effectively transfer the escape key to the "in focus" window.
 
 Thoughts????
 
 Here is part of my macro:
 
 if(ph_findwindow("Open file(s)",1)>0, 1, 999)
 ph_switchto("Open file(s)",1)
 Wait 1
 ph_sendkeys("{ESC}")
 
 
 
 
 __________________
 Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | smarty Super User
 
  
  
 Joined: May 21 2006
 Location: United States
 Online Status: Offline
 Posts: 729
 | 
          NEVER MIND!!!!
           | Posted: October 01 2006 at 14:33 | IP Logged |   |  
           | 
 |  
 {ESC} should NOT be in all CAPS.  It should be {esc}.
 
 
 
 __________________
 Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          Sorry about that. Post updated.
           | Posted: October 01 2006 at 15:38 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |       | 
       
       
        |  | 
        | smarty Super User
 
  
  
 Joined: May 21 2006
 Location: United States
 Online Status: Offline
 Posts: 729
 | 
          Forgot to say THANKYOU!!
           | Posted: October 01 2006 at 17:06 | IP Logged |   |  
           | 
 |  
 Your help is VERY MUCH appreciated.
   
 __________________
 Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
 | 
       
        | Back to Top |     | 
       
       
        |  |