Type TMain = class(TForm)
....
public
{ Public declarations }
procedure WMSize(var Message: TWMSize); message WM_SIZE;
.....
procedure Tform1.WMSize(var Message: TWMSize);
begin
inherited;
if WindowState = wsMaximized then
begin
....
end;
if WindowState = wsMinimized then
begin
....
end;
if WindowState = wsNormal then
begin
....
end;
end;