详细一点:
type
TForm1 = class(TForm)后,Private前面写:
procedure SysCommand(var msg:TWMSysCommand);message WM_SysCommand;
实现;
procedure TForm1.SysCommand(var msg: TWMSysCommand);
begin
if msg.CmdType = SC_CLOSE then
begin
msg.cmdtype:= SC_DEFAULT;
Hide;
end;
inherited;
end;