End program on startup?

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Aug 2006
Posts: 999
Reputation: EnderX is an unknown quantity at this point 
Solved Threads: 1
EnderX EnderX is offline Offline
Posting Shark

End program on startup?

 
0
  #1
Sep 7th, 2006
I'm currently trying to create a program in delphi to call up a webpage; the page is written in php and records some data about its contents for record-keeping in my system. I'd like to be able to write the program so that when it opens it does the following:

1. Opens the webpage. I can do this, I found the code to open an application via ShellApi some time ago and it works just as well for a web url as for a file path.

2. Closes the webpage. I only really need to run the page once to do the job, and if the program can close the page afterwards it should. Again, I found some code on how to do this, so that's not really a problem, although I may need to build in a delay; as currently written, it doesn't like to close the page. This isn't critical though, it's merely my own personal aesthetics.

3. Closes the program itself. I know you can close a program with a single form (all this one has) by using the form.close procedure, except that this doesn't work when the statement is included in the form.formcreate procedure, and that's where I'm hoping to call it from.

Is it even possible to code my program so it fits this set of instructions, or should I start looking for a workaround?

Thanks in advance,
-EnderX
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 523
Reputation: pty is on a distinguished road 
Solved Threads: 37
pty's Avatar
pty pty is offline Offline
Posting Pro

Re: End program on startup?

 
1
  #2
Sep 7th, 2006
Originally Posted by EnderX View Post
I'm currently trying to create a program in delphi to call up a webpage; the page is written in php and records some data about its contents for record-keeping in my system. I'd like to be able to write the program so that when it opens it does the following:

1. Opens the webpage. I can do this, I found the code to open an application via ShellApi some time ago and it works just as well for a web url as for a file path.

2. Closes the webpage. I only really need to run the page once to do the job, and if the program can close the page afterwards it should. Again, I found some code on how to do this, so that's not really a problem, although I may need to build in a delay; as currently written, it doesn't like to close the page. This isn't critical though, it's merely my own personal aesthetics.

3. Closes the program itself. I know you can close a program with a single form (all this one has) by using the form.close procedure, except that this doesn't work when the statement is included in the form.formcreate procedure, and that's where I'm hoping to call it from.

Is it even possible to code my program so it fits this set of instructions, or should I start looking for a workaround?

Thanks in advance,
-EnderX
Pascal and Delphi Syntax (Toggle Plain Text)
  1. application.terminate;
Note to self... pocket cup
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 999
Reputation: EnderX is an unknown quantity at this point 
Solved Threads: 1
EnderX EnderX is offline Offline
Posting Shark

Re: End program on startup?

 
0
  #3
Sep 8th, 2006
Worked like a charm. Thank you very much for your quick assistance.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Pascal and Delphi Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC