参考一下:
TForm1 = class(TForm)
private
procedure WMSysCommand(var Message:TWMSysCommand);
message WM_SYSCOMMAND;
end;
procedure TForm1.WMSysCommand(var Message:TWMSysCommand);
message WM_SYSCOMMAND;
begin
case Message.CmdType of
SC_MINIMIZE: //最小化
SC_MAXIMIZE: //最大化
SC_RESTORE: //恢复
end;
inherited;
end;