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 !!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try this
procedure TForm1.FormDestroy(Sender: TObject);
begin
Application.ProcessMessage s;
Application.Terminate;
end;
procedure TForm1.FormDestroy(Sender:
begin
Application.ProcessMessage
Application.Terminate;
end;
Calling Application.ProcessMessage s 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.
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.
-> i would say its a windows bug
to avoid simple hide the app before closing