Delphi closes the program close,application. The difference between terminate and halt

Source: Internet
Author: User

when Close is a main form, the program exits.
close will occur Formclose event, Formclosequery event
The Formdestory event will occur in Halt,
None of the above three events will occur application.terminate

Application.terminate is the end of the program. The entire program ends and the system forcibly reclaims the system resources.

terminate is automatically called when the main window is closed or when the wm_quit message is triggered
Close, just for the form. The main form close after the program is application.terminate.
The subform close later. You can show it without releasing it.

It is also said that the close method of the main window is actually called application's terminate to terminate the program.
Application.close is normal exit, there is an application to voluntarily return system resources


Another difference is that the Close method of the main window can trigger the OnClose event
the application.terminate does not trigger the event.

Delphi Closes the program close,application. Terminate and halt differences

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.