Application.terminate just call PostQuitMessage. This Windows API indicates that the program is ready to be finished, and that it does not immediately abort the entire program, nor does it force the end of any other program to run. The program is likely to happen as you describe the situation application.terminate, please refer to the help of Delphi, although it is not a lot of exitprocess, it is a direct and clean End program MSDN for details, please refer to: H Ttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcekernl/html/_wcesdk_win32_ Exitprocess.asp look at the example below: [Delphi] View Plaincopy01.procedure Tform1.button1click (sender:tobject); 02.begin . Application.terminate; 04.end; 06.procedure Tform1.button2click (sender:tobject); 07.var . B:boolean; 09.begin . B:=false; repeat . Application.processmessages; Sleep (+); until B; 15.end;
ExitProcess and application.termined