?
Solved

Problem closing the Compiled Program

Posted on 2003-03-11
6
Medium Priority
?
140 Views
Last Modified: 2010-05-18
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
Comment
Question by:Fredy992
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8110391
happens sometimes, and not only for delphi-apps
-> i would say its a windows bug

to avoid simple hide the app before closing
0
 
LVL 6

Accepted Solution

by:
DaFox earned 750 total points
ID: 8110428
Hi!

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

Markus
0
 
LVL 1

Expert Comment

by:krukmat
ID: 8111194
try this

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

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 6

Expert Comment

by:swift99
ID: 8116516
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
 
LVL 1

Expert Comment

by:Maximilianop
ID: 8116546
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
 
LVL 3

Expert Comment

by:Aliev
ID: 8124693
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question