Intercepta el mensaje WM_SYSCOMMAND:
Código Delphi
[-]
interface
type
TForm1 = class(TForm)
private
procedure WMSysCommand(var Msg: TWMSysCommand);
end;
implementation
procedure TForm1.WMSysCommand(var Msg: TWMSysCommand);
begin
if (Msg.CmdType and $FFF0 = SC_MAXIMIZE) then
begin
end
else if (Msg.CmdType and $FFF0 = SC_RESTORE)
begin
end;
inherited;
end;
LineComment Saludos