Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Is there a "Close Application" Formula ? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: July 16 2006 at 16:05 | IP Logged Quote nadler

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?
Back to Top View nadler's Profile Search for other posts by nadler
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: July 16 2006 at 17:26 | IP Logged Quote TonyNo

Have you tried sending a control-w or alt-f4 to the window?
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: July 16 2006 at 18:57 | IP Logged Quote nadler

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.
Back to Top View nadler's Profile Search for other posts by nadler
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: July 16 2006 at 19:38 | IP Logged Quote TonyNo

I believe Dave suggests switching to ph first, then to your desired app. Works more consistantly.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
Manny
Senior Member
Senior Member
Avatar

Joined: March 23 2003
Location: United States
Online Status: Offline
Posts: 172
Posted: October 11 2006 at 01:15 | IP Logged Quote Manny

If running XP you can try the
Taskkill command.
Back to Top View Manny's Profile Search for other posts by Manny
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 12 2006 at 13:06 | IP Logged Quote dhoward

Manny,

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: October 12 2006 at 16:36 | IP Logged Quote nadler

Dave, it this the correct syntax?

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 View nadler's Profile Search for other posts by nadler
 
Manny
Senior Member
Senior Member
Avatar

Joined: March 23 2003
Location: United States
Online Status: Offline
Posts: 172
Posted: October 12 2006 at 16:41 | IP Logged Quote Manny

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?

It would give me something to read while "working"....

Edited by Manny - October 12 2006 at 21:54
Back to Top View Manny's Profile Search for other posts by Manny
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 12 2006 at 23:49 | IP Logged Quote dhoward

Noel,

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: October 13 2006 at 08:04 | IP Logged Quote nadler

That did it! Yet, another formula I would never have been able to figure out by myself.

Thanks, Dave!
Back to Top View nadler's Profile Search for other posts by nadler
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 17 2006 at 16:35 | IP Logged Quote dhoward

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.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: October 17 2006 at 17:28 | IP Logged Quote nadler

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)
Back to Top View nadler's Profile Search for other posts by nadler
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 18 2006 at 21:21 | IP Logged Quote dhoward

Noel,

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
Manny
Senior Member
Senior Member
Avatar

Joined: March 23 2003
Location: United States
Online Status: Offline
Posts: 172
Posted: October 20 2006 at 13:47 | IP Logged Quote Manny

Dave,
Does the DCC handle this new feature?

Most of my control of other applications happen on the non PH machine.

Manny
Back to Top View Manny's Profile Search for other posts by Manny
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 24 2006 at 15:38 | IP Logged Quote dhoward

Manny,

Not yet...I'll be putting out a new DCC soon with the updated PowerHome functions included (including this one).

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
Manny
Senior Member
Senior Member
Avatar

Joined: March 23 2003
Location: United States
Online Status: Offline
Posts: 172
Posted: October 24 2006 at 15:51 | IP Logged Quote Manny

Sweeeeeet!

Thanks.
Back to Top View Manny's Profile Search for other posts by Manny
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum