Re: restart application
- From: Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx>
- Date: Sun, 26 Nov 2006 16:55:01 -0500
Maarten Wiltink wrote:
"Rob Kennedy" <me3@xxxxxxxxxxx> wrote in messagehow about if you need to reload different versions of DLL's?
news:4srv1sF114sgfU1@xxxxxxxxxxxxxxxxxxxxx
Jamie wrote:
Ingolf wrote:
<jimbo@xxxxxxxxxx> wrote in message
news:1164362542.923132.96860@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
How can I on the click of a button "restart" my program. That is
reset all the defaults. Can a program close and reopen itself?
Looked at initialize but don't understand what it all means. TIA
procedure TForm1.Button1Click(Sender: TObject);
begin
winexec(PAnsiChar(paramstr(0)),SW_SHOWNORMAL);
halt(0);
end;
what if!
The app has code in it to prevent multiple copies?
Well, it's Jim's own program, so he should be able to detect that
pretty easily. And if he doesn't know how to address the issue, he
can write back with details of how he's preventing multiple copies
so we can tell him how to circumvent it.
I think too much has been made of the 'restart' in the original
question (amazingly still present above). The question is, I feel,
more about reinitialising its state.
That should be easy. Have a method in the main form class that
resets all fields to their default/empty values, reloads data,
handles command line parameters, etcetera.
As a matter of proselytisation, it is documented that the default
constructor should do all that (well, perhaps not the handling of
the command line parameters), and I've indeed found it to be an
excellent place for it.
Groetjes,
Maarten Wiltink
--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
.
- Follow-Ups:
- Re: restart application
- From: Maarten Wiltink
- Re: restart application
- From: Rob Kennedy
- Re: restart application
- References:
- restart application
- From: jimbo
- Re: restart application
- From: Ingolf
- Re: restart application
- From: Jamie
- Re: restart application
- From: Rob Kennedy
- Re: restart application
- From: Maarten Wiltink
- restart application
- Prev by Date: Re: restart application
- Next by Date: Re: TimeSetEvent
- Previous by thread: Re: restart application
- Next by thread: Re: restart application
- Index(es):