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

Recommended Answers

All 2 Replies

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

application.terminate;
commented: Quick response, accurate information. Quite nice. +1

Worked like a charm. Thank you very much for your quick assistance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.