Mega Code Archive

 
Categories / Delphi / System
 

Disable the system menu close button

Title: 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! Achtung: Die Form kann immer noch mit Alt-F4 geschlossen werden! }