943,724 Members | Top Members by Rank

Ad:
Sep 7th, 2006
0

End program on startup?

Expand 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
Similar Threads
Reputation Points: 483
Solved Threads: 1
Posting Shark
EnderX is offline Offline
999 posts
since Aug 2006
Sep 7th, 2006
1

Re: End program on startup?

Click to Expand / Collapse  Quote originally posted by EnderX ...
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;
pty
Reputation Points: 64
Solved Threads: 39
Posting Pro
pty is offline Offline
530 posts
since Oct 2005
Sep 8th, 2006
0

Re: End program on startup?

Worked like a charm. Thank you very much for your quick assistance.
Reputation Points: 483
Solved Threads: 1
Posting Shark
EnderX is offline Offline
999 posts
since Aug 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Escaping symbols in strings?
Next Thread in Pascal and Delphi Forum Timeline: Can't understand why this won't compile





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC