procedure TForm1.WMSyscommand(var msg: TWmSysCommand); begin
case (msg.CmdType and $FFF0) of SC_MINIMIZE: begin ShowMessage('Window about to MINIMIZE'); end;
SC_RESTORE : begin ShowMessage('Window about to RESTORE'); end;
SC_MAXIMIZE: begin ShowMessage('Window about to MAXIMIZE'); end; end; inherited; end;
procedure TForm1.WMSize(var msg: TWMSize); begin
If msg.Sizetype = SIZE_MAXIMIZED then ShowMessage('Window MAXIMIZED'); inherited; end;