Mega Code Archive

 
Categories / Delphi / Forms
 

Close the program with one fatal error message

Title: Close the program with one fatal error message Question: How to close program whit message of warning to User? Answer: Put in uses of unit: Windows procedure TForm1.Button1Click(Sender: TObject); begin FatalAppExit(0, 'Fatal Error in application. Please contact the Suport help departament!'); end; Observations: The FatalAppExit function is a API of the Win32. This show a Dialogbox (normally white) with the message passed in as the second parameter. When the dialogbox is closed, the application is finished. The OnCloseQuery event of forms is not called when we use this function.