• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 141
  • Last Modified:

Problem closing the Compiled Program

I made a program in Delphi 5. I compiled it and executed normally. It works Ok but when I Close the program, Windows leaves a blank bar in the task bar. What is it ??? What can I do. All of the other program that I did didn't do this. Please someone HELP !!
0
Fredy992
Asked:
Fredy992
1 Solution
 
kretzschmarCommented:
happens sometimes, and not only for delphi-apps
-> i would say its a windows bug

to avoid simple hide the app before closing
0
 
DaFoxCommented:
Hi!

procedure TForm1.FormDestroy(Sender: TObject);
begin
  ShowWindow(Application.Handle, SW_MINIMIZE);
end;

Markus
0
 
krukmatCommented:
try this

procedure TForm1.FormDestroy(Sender: TObject);
begin
  Application.ProcessMessages;
  Application.Terminate;
end;

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
swift99Commented:
Calling Application.ProcessMessages like this is dangerous, since it may lead to unintended recursion.  In "destroy" events, it may also lead to hard to track memory exceptions since the form may have been destroyed before returning from to the FormDestroy method.  This is a real pain in the ... to track down.
0
 
MaximilianopCommented:
It sometime happens, it is because the windows kernel, couldn't process the exit code of the app quickly enough, it's not a delphi bug.

The best way to fix it, is to hide the form on the OnCloseQuery event, and then on the Close Event, set proceesmessages, to force windows to listen to the app.
0
 
AlievCommented:
It is windows error.And not only with delphi programs.It was at my comp in Word and Excel and in games.One click to blank bar .It was invinsible.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now