Link to home
Start Free TrialLog in
Avatar of Fredy992
Fredy992

asked on

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 !!
Avatar of kretzschmar
kretzschmar
Flag of Germany image

happens sometimes, and not only for delphi-apps
-> i would say its a windows bug

to avoid simple hide the app before closing
ASKER CERTIFIED SOLUTION
Avatar of DaFox
DaFox

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of krukmat
krukmat

try this

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

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.
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.
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.