System Delphi

procedure TForm1.FormCreate(Sender: TObject);
begin
KeyPreview := true;
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((ssAlt in Shift) and (Key = VK_F4)) then
Key := 0;
end;