Mega Code Archive

 
Categories / Delphi / System
 

How to disable the system menu close button

Title: How to disable the system menu close button procedure TForm1.FormCreate(Sender: TObject); begin EnableMenuItem(GetSystemMenu(Form1.Handle, LongBool(False)), SC_CLOSE, MF_BYCOMMAND or MF_GRAYED); end; Note: You can still press Alt-F4 to close the form!