Board index » delphi » Close a minimized/invisible application.

Close a minimized/invisible application.

Hi!
I have a problem closing my application.
My mainform starts minimized and via a timer executes some code automatic,
that's okay.
But when I finally call the 'Close' method nothing happens. I have checked
that it calls first OnCloseQuery (returns True) and OnClose where I set
Action to caFree.
But it doesn't actually close.
I use a trayicon component and I can restore my application from there. When
I do so (after it should have closed) it restores normally but when I move
the mouse over it finally closes totally.

Can anyone please save the last 2 hairs before they also turn grey?
Thanks in advance.

--
Yours

Poul Bak

 

Re:Close a minimized/invisible application.


try
Application.Terminate;
that sends all the necessary messages to all the components, if the icon doesn't go away, there's a chance that's
windows bug.
Quote
"Poul S. Bak" wrote:
> Hi!
> I have a problem closing my application.
> My mainform starts minimized and via a timer executes some code automatic,
> that's okay.
> But when I finally call the 'Close' method nothing happens. I have checked
> that it calls first OnCloseQuery (returns True) and OnClose where I set
> Action to caFree.
> But it doesn't actually close.
> I use a trayicon component and I can restore my application from there. When
> I do so (after it should have closed) it restores normally but when I move
> the mouse over it finally closes totally.

> Can anyone please save the last 2 hairs before they also turn grey?
> Thanks in advance.

> --
> Yours

> Poul Bak

Re:Close a minimized/invisible application.


Hi and thanks, but ....!!!!
I have tried both Application.Terminate and Form.Release.
Form.Release does make the form disappear, but the application remains on
the Windows-process-list (Ctrl-Alt-Del) for about 2 minutes before it
disappears totally. There must be a better way.
Has nobody experienced the same?
Does anybody know some tips (or where to find them) on running an
application invisible?
Thanks in advance.
--
Yours

Poul Bak

Poul S. Bak <poul.s....@get2net.dk> skrev i en
nyhedsmeddelelse:875of9$b1...@news.inet.tele.dk...

Quote
> Hi!
> I have a problem closing my application.
> My mainform starts minimized and via a timer executes some code automatic,
> that's okay.
> But when I finally call the 'Close' method nothing happens. I have checked
> that it calls first OnCloseQuery (returns True) and OnClose where I set
> Action to caFree.
> But it doesn't actually close.
> I use a trayicon component and I can restore my application from there.
When
> I do so (after it should have closed) it restores normally but when I move
> the mouse over it finally closes totally.
> --
> Yours

> Poul Bak

Other Threads